On Thu, Oct 21, 2010 at 2:41 AM, Kim Gräsman <[email protected]> wrote:
> Hi Dean,
>
> On Wed, Oct 20, 2010 at 14:39, Dean Michael Berris
> <[email protected]> wrote:
>>>
>>>
>>> I'm unconvinced that COW strings can be depended on as a central
>>> library feature- a quick Google seems to indicate otherwise.
>>>
>>> http://bit.ly/hiqqU
>>> http://bit.ly/cqpKVN
>>>
>>
>> cpp-netlib doesn't depend on COW, but most implementations do
>> implement std::string with COW optimizations. This means, GNU's
>> libstdc++ has a COW string, Dinkumware (now Microsoft's STL)
>> implements it as well. Worrying about copies only matters if it's
>> really affecting the performance of the application.
>
> Microsoft's STL as of VS2008 doesn't use COW, it uses the small-string
> optimization. Not sure if they went (back?) to COW in 2010, but I
> doubt it.
>

Oh, then my info on MS STL would still be pre-2008. Thanks for the
update. I learn something new everyday. :D

> LLVM has an interesting sub-project implementing a standard library
> from scratch, and one of the decisions they mention in the overview is
> using small string optimization over COW, as if it was a plain truth;
> http://libcxx.llvm.org/.
>

Yeah, I've been following that too. That's interesting, although that
will be a C++0x standard library. I don't want to wait for C++0x to
come along to make my life a lot easier in implementing cpp-netlib. :D

> So, I think there's merit to not expecting COW from std::string.
>

Yup, but I haven't been writing cpp-netlib to expect COW. I just think
that removing copies can be done later on. ;)

-- 
Dean Michael Berris
deanberris.com

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Cpp-netlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel

Reply via email to