[c++0x] unique_ptr

Rodolfo Lima rodolfo@rodsoft.org
Wed Jun 11 01:09:00 GMT 2008


Chris Fairles escreveu:
> Round 2 - patch attached (albeit, untested)

It seems that there are some changes required in shared_ptr to work with 
unique_ptr, as in:

std::unique_ptr<int> uptr(new int(5));

std::shared_ptr<int> sptr = uptr;
assert((bool)uptr == false);

This way unique_ptr can substitute auto_ptr nicely.

Also, maybe Paolo can confirm this, but there's an active issue #740 by 
Herb Sutter regarding the static array partial specialization. They're 
planning not to provide this partial specialization.

Reference: 
http://home.twcny.rr.com/hinnant/cpp_extensions/issues_preview/lwg-active.html#740

I've been using your unique_ptr implementation for a while now and it's 
been working great so far.

Regards,
Rodolfo Lima.



More information about the Libstdc++ mailing list