lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Jul 29, 2013 at 11:58 PM, Ross Bencina
<rossb-lists@audiomulch.com> wrote:
> On 30/07/2013 10:51 AM, Coda Highland wrote:
>>
>> If your C++ vectors are getting copied around like that, your STL
>> implementation sucks. Good implementations provide copy-on-write
>> semantics or (as of C++11) move semantics.
>
>
> I'm pretty sure C++ std::vector is never implemented with COW. That would
> make array access on a vector more expensive than using a raw array.
>
> Even COW on std::string is not all its cracked up to be.
>
> Ross.
>

Which is why C++11 implements move semantics, which solves the problem
beautifully.

/s/ Adam