[opensource-dev] Replacement class for LLDynamicArray

Henri Beauchamp sldev at free.fr
Fri May 9 06:12:02 PDT 2014


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<Type>::operator[](index); }
> 
> Is array[i] same as operator[](i) ?

Yep. It's just the way the [] operator is declared in C++. See:
http://www.cplusplus.com/reference/vector/vector/operator%5B%5D/

> I notice "operator[](i)" is used in the interesting,

With std::vector, you could also use array.at(i), which is equivalent.

Henri.


More information about the opensource-dev mailing list