This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to use __versa_string as std::string implementation?


[Oops, I shot myself in the foot by using a mail address that I'd rather keep spam free, in my previous message! I'm surprised the message was forwarded straight to the mailing list, because it wasn't the address I used when I subscribed.]

Do I understand correctly that the current GCC implementation of
std::string is non-conforming, because it does ref-counting +
copy-on-write?

Paolo Carlini wrote:
If you mean by non-conforming "non-conforming to the not existing yet
new C++ standard, so far known as C++0x", the answer is yes.

Thanks, that's what I meant indeed. (In fact I got the word "conforming" from gcc.gnu.org/gcc-4.1/changes.html which says that __versa_string provides "facilities conforming to the standard requirements for basic_string". But indeed, C++03 does allow COW implementations of std::string.)


If I understand well, the Versatile String, __versa_string from
<ext/vstring.h>  provides such an implementation, right?  Is there an
easy way to recompile existing user code that uses std::string, in
order to switch to a non-ref-counting implementation?

Nothing special, no. And of course that code is just a starting point.
Before advertising is a "conforming" (in the sense above) implementation
has to be reviewed, some optimizations added, etc...

Okay, so basically __versa_string is a starting point for the std::string implementation of the future, right? Is there any target date or target GCC release version for this new implementation to be included as the new std::basic_string?


Thanks again,

  Niels
--
Niels Dekker
http://www.xs4all.nl/~nd/dekkerware
Scientific programmer at LKEB, Leiden University Medical Center


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]