Getting completely (I mean ENTIRELY) rid off GC

po via Digitalmars-d digitalmars-d at puremagic.com
Sun Sep 14 07:19:51 PDT 2014


> I mean possible lifetime management options are:
> 1. string&
> 2. string*
> 3. shared_ptr<string>
> 4. weak_ptr<string>
> 5. unshared_ptr<string> (not interlocked; does something like 
> this exist?)
>
> This way string is just like any other object. It's C++ after 
> all, the foot must be shot.

  Exactly, you can compose string with the semantics you want!
  You are making C++ look good:) Although I can't recall ever 
actually wrapping a string in shared_ptr/weak_ptr/unique_ptr...

>6. string::c_str() (let char* botch string internals)

It returns a const char* so you would have to cast const away to 
do that--


More information about the Digitalmars-d mailing list