Re: CString help
- From: "Doug Harrison [MVP]" <dsh@xxxxxxxx>
- Date: Sun, 24 Jun 2007 16:21:04 -0500
On Sun, 24 Jun 2007 14:11:59 -0700, "Mihai N." <nmihai_year_2000@xxxxxxxxx>
wrote:
(and in fact I think I know a case where this might break: flex_string of
Andrei Alexandrescu, a very nice string class, standard compliant).
But flex_string != std::basic_string. I skimmed the DDJ article here:
http://www.ddj.com/dept/cpp/184403784
I see Andrei talked at length about "Standard-compliant" and COW. The
problem is, the two aren't compatible, at least if you think
"copy-on-write" actually means "copy-on-write".
I don't think there is any standard requirement for "copy-on-write" behavior,
that is implementation speciffic.
Of course the standard doesn't require it. What I was getting at is that
the standard does not permit COW.
for me standard-compliant is good enough. It means at any time some
compiler crator can decide to drop his implementation and adopt Andrei's
implementation.
Even the DDJ article says "a policy-based basic_string implementation"
It is an implementation, and I don't know based on what criteria one can
say that flex_string != std::basic_string
I don't know any standard library implementation that comes with
flex_string renamed to basic_string.
The standard does not provide an implementation. So if I write something
that exposes all the public behavior and methods required by the C++
standard for std::basic_string, then the class *is* std::basic_string
And you should feel free to use it. Just make sure you've observed all the
little nuances necessary to use std::string in a truly portable way.
--
Doug Harrison
Visual C++ MVP
.
- Follow-Ups:
- Re: CString help
- From: Mihai N.
- Re: CString help
- References:
- CString help
- From: jp2code
- Re: CString help
- From: Ajay Kalra
- Re: CString help
- From: jp2code
- Re: CString help
- From: David Wilkinson
- Re: CString help
- From: Mihai N.
- Re: CString help
- From: Doug Harrison [MVP]
- Re: CString help
- From: Mihai N.
- Re: CString help
- From: Doug Harrison [MVP]
- Re: CString help
- From: Mihai N.
- CString help
- Prev by Date: Re: CString help
- Next by Date: Re: CString help
- Previous by thread: Re: CString help
- Next by thread: Re: CString help
- Index(es):
Relevant Pages
|
Loading