Containers

Steven Schveighoffer schveiguy at gmail.com
Wed Sep 1 11:13:27 UTC 2021


On 8/31/21 8:52 PM, deadalnix wrote:
> On Tuesday, 31 August 2021 at 23:56:51 UTC, Steven Schveighoffer wrote:
>> I don't agree that COW is a good idea for generic collections. IIRC, 
>> C++ tried this with std::string and it was a disaster.
>>
> 
> You seem to be confused. The C++11 standard prohibits std::string from 
> using COW. Existing C++ implementations were using COW, and getting out 
> of it was what was a disaster (notably, there were breaking ABI changes, 
> which the C++ ecosystem is not well suited to handle).

Isn't the reason they prohibited COW is because of the problems with it?

Not saying COW is terrible in all cases, just that a generic container 
(non-specialized usage) should not be COW. If you need that feature, you 
should have to ask for it, not have it be an implementation detail.

-Steve


More information about the Digitalmars-d mailing list