Re: CString help



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
.



Relevant Pages

  • Re: Minimum VC++ for Multi-Core?
    ... My impression was that the draft had a lot of wiggle room that allowed the COW ... ..but VC6's std::string is much older than the standard. ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: Minimum VC++ for Multi-Core?
    ... I'm so used to thinking of VC6 as 'old' and the ISO standard as ... Yes, sorry, I missed your point about *real* COW. ... make optimizations based on sharing the string buffer but can't legally use ...
    (microsoft.public.vc.mfc)
  • Re: [newbie] strcpy, strtok and strcat problem...
    ... I suspect you meant to type something other than ... "standard" here, but I don't know what it was. ... Maybe "re-entrant"? ... A cow flew by. ...
    (comp.lang.c)
  • Re: CString help
    ... Andrei Alexandrescu, a very nice string class, standard compliant). ... I see Andrei talked at length about "Standard-compliant" and COW. ...
    (microsoft.public.vc.mfc)
  • Re: Script error on Google Homepage
    ... :> compliant or you're not. ... :>> how innerHTML support should look? ... : browser to browser! ... getAttribute behavior is not standard between ...
    (microsoft.public.scripting.jscript)

Loading