Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Tateru Nino
On 10/05/2014 2:35 AM, Brian McGroarty wrote: > On Fri, May 9, 2014 at 8:43 AM, Nicky D. > wrote: > > True, but on the other hand, you'd never call array[i] with i > out of > array bound (it would be a bug, and throwing an exception via >

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Nicky D.
> > > Slight tweak: [] on out of bounds members is undefined, but specific > implementations may still check. > > Most (maybe even all) STL implementations support bounds checking with a > compile flag. If anyone's eager to experiment, it would be nice to add that > to the debug build flags and see

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Brian McGroarty
On Fri, May 9, 2014 at 8:43 AM, Nicky D. wrote: > > True, but on the other hand, you'd never call array[i] with i out of >> array bound (it would be a bug, and throwing an exception via the use >> of at(i) is no better than "undefined behaviour" > > that will also lead to a crash in the end). > >

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Brian McGroarty
On Fri, May 9, 2014 at 6:37 AM, Nicky D. wrote: > >> > I notice "operator[](i)" is used in the interesting, >> >> With std::vector, you could also use array.at(i), which is equivalent. > > > vector::at will do a runtime check if the index is out of bounds, in that > case it throws > an exception.

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Nicky D.
> > True, but on the other hand, you'd never call array[i] with i out of > array bound (it would be a bug, and throwing an exception via the use > of at(i) is no better than "undefined behaviour" that will also lead to a crash in the end). Wrong. See Heartbleed. It depends on if the page behind

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Henri Beauchamp
On Fri, 9 May 2014 15:37:15 +0200, Nicky D. wrote: > > > I notice "operator[](i)" is used in the interesting, > > > > With std::vector, you could also use array.at(i), which is equivalent. > > vector::at will do a runtime check if the index is out of bounds, in > that case it throws an exception.

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Lance Corrimal
Am Freitag, 9. Mai 2014, 15:54:10 schrieb Ambrosia: > make that items->at(i) to match your example. > > On Fri, May 9, 2014 at 3:53 PM, Ambrosia wrote: > > array->at(i), if 'array' is a pointer to a vector. Thanks!!! Cheers, LC ___ Policies and (un

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Ambrosia
I have a copy of viewer-interesting that I patched with code from my NaCl-release repo. I can upload it to my repo later so you can see examples of how I converted custom code to the new types. On Fri, May 9, 2014 at 3:52 PM, Nicky Perian wrote: > haven't tried, looks like the best choice is it

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Ambrosia
make that items->at(i) to match your example. On Fri, May 9, 2014 at 3:53 PM, Ambrosia wrote: > array->at(i), if 'array' is a pointer to a vector. > > --Chalice Yao > > > On Fri, May 9, 2014 at 3:47 PM, Lance Corrimal > wrote: > >> Am Freitag, 9. Mai 2014, 15:37:15 schrieb Nicky D.: >> > > > I

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Ambrosia
array->at(i), if 'array' is a pointer to a vector. --Chalice Yao On Fri, May 9, 2014 at 3:47 PM, Lance Corrimal wrote: > Am Freitag, 9. Mai 2014, 15:37:15 schrieb Nicky D.: > > > > I notice "operator[](i)" is used in the interesting, > > > > > > With std::vector, you could also use array.at(i),

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Nicky Perian
haven't tried, looks like the best choice is items->array.at(i) On Friday, May 9, 2014 8:47 AM, Lance Corrimal wrote: Am Freitag, 9. Mai 2014, 15:37:15 schrieb Nicky D.: >> > > I notice "operator[](i)" is used in the interesting, >> > >> > With std::vector, you could also use array.at(i), w

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Lance Corrimal
Am Freitag, 9. Mai 2014, 15:37:15 schrieb Nicky D.: > > > I notice "operator[](i)" is used in the interesting, > > > > With std::vector, you could also use array.at(i), which is equivalent. So what would i do with a items->get(i) (excuse my stupid)? Cheers LC ___

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Nicky D.
> > > > I notice "operator[](i)" is used in the interesting, > > With std::vector, you could also use array.at(i), which is equivalent. > > vector::at will do a runtime check if the index is out of bounds, in that case it throws an exception. vector::operator[] will not do this check, causing unde

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Henri Beauchamp
On Fri, 9 May 2014 05:17:42 -0700 (PDT), Nicky Perian wrote: > >"array[i]" instead of "array.get(i), etc... > > > old code snip  const Type& get(S32 index) const { return > std::vector::operator[](index); } > > Is array[i] same as operator[](i) ? Yep. It's just the way the [] operator is decl

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Nicky Perian
>"array[i]" instead of "array.get(i), etc... old code snip  const Type& get(S32 index) const { return std::vector::operator[](index); } Is array[i] same as operator[](i) ? I notice "operator[](i)" is used in the interesting, Nicky On Friday, May 9, 2014 6:14 AM, Nicky Perian wrote: forg

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Nicky Perian
forgot the link to the standard  cppreference.com cppreference.com optional  (library fundamentals TS) any  (library fundamentals TS) string_view   (library fundamentals TS) memory_resource  (library fundamentals TS) Filesystem library  (filesystem TS) View on en.cppreference.com Preview b

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Nicky Perian
bring up lldarray.h from the old version. Look at the underlying code for the std::vector methods that were wrapped there. add #include where needed. find std::vector method in the standard. using the standard and the old header modify the code.___ Poli

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Henri Beauchamp
On Fri, 09 May 2014 09:24:41 +0200, Lance Corrimal wrote: > Hi, > > And what did they terll you there? Please share, I'm banging my head against > the same thing. > > Cheers, > LC > > Am Donnerstag, 8. Mai 2014, 15:34:39 schrieb Nicky Perian: > > Never mind, got guidance from the #opensl > >

Re: [opensource-dev] Replacement class for LLDynamicArray

2014-05-09 Thread Lance Corrimal
Hi, And what did they terll you there? Please share, I'm banging my head against the same thing. Cheers, LC Am Donnerstag, 8. Mai 2014, 15:34:39 schrieb Nicky Perian: > Never mind, got guidance from the #opensl > > > On Thursday, May 8, 2014 4:48 PM, Nicky Perian > wrote: > > LLDynamicArr