[RFC] On the uses of less<>() in basic_string

Paolo Carlini pcarlini@suse.de
Wed Feb 4 17:30:00 GMT 2004


Bo Persson wrote:

> Why? Just just std::less<> for everything.

This is a simple very good suggestion. Thanks!

> No peeking! :-)
>
> How do you know that traits::copy uses memcpy? That is an implementation
> detail that is specifically delegated to char_traits, so that you 
> shouldn't
> have to care about that in basic_string. Just use it!

This is something interesting (i.e., I'm not sure what the standard says ;)

As far as the instantiations for char and wchar_t are concerned, as an
implementor I'm allowed to peek, right?

As far as the instantiations for whatever != {char, wchar_t} are concerned,
is really a user of the library supposed to provide a less<>() consistent
with char_traits? Can you enlighten me about that?

Paolo.



More information about the Libstdc++ mailing list