Home » U++ Library support » U++ Core » Ptr improve
Re: Ptr improve [message #32446 is a reply to message #32408] |
Wed, 18 May 2011 11:40   |
 |
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
for this matter
http://www.cplusplus.com/reference/std/memory/auto_ptr/
http://www.boost.org/doc/libs/1_46_1/libs/smart_ptr/smart_pt r.htm
std::auto_ptr -> UPP::One<>, sole ownership, not shared amongst others, pick semantic
Quote: |
Conceptually, smart pointers are seen as owning the object pointed to, and thus responsible for deletion of the object when it is no longer needed.
The smart pointer library provides six smart pointer class templates:
scoped_ptr <boost/scoped_ptr.hpp> Simple sole ownership of single objects. Noncopyable.
scoped_array <boost/scoped_array.hpp> Simple sole ownership of arrays. Noncopyable.
shared_ptr <boost/shared_ptr.hpp> Object ownership shared among multiple pointers.
shared_array <boost/shared_array.hpp> Array ownership shared among multiple pointers.
weak_ptr <boost/weak_ptr.hpp> Non-owning observers of an object owned by shared_ptr.
intrusive_ptr <boost/intrusive_ptr.hpp> Shared ownership of objects with an embedded reference count.
These templates are designed to complement the std::auto_ptr template.
|
scoped_ptr is a restricted version of One<>
shared_ptr shares ownership of same object among multiple shared_ptr instances (aka ref count, or Value). for this we dont have a 'clean' leightweight implementations, sth like Shared<> would be great.
weak_ptr is a weak ref, pointing same stuff shared_ptr already points to, comparable to Ptr<>, it doesnt hold ownership, just as Ptr<> doesnt, so we actually *do* have allmost all of it.
maybe we really should consider to implement such a shared ownership container, sth like Shared<>
[Updated on: Wed, 18 May 2011 11:42] Report message to a moderator
|
|
|
 |
|
Ptr improve
By: tojocky on Mon, 16 May 2011 14:07
|
 |
|
Re: Ptr improve
By: mirek on Mon, 16 May 2011 15:05
|
 |
|
Re: Ptr improve
By: tojocky on Mon, 16 May 2011 15:31
|
 |
|
Re: Ptr improve
By: tojocky on Mon, 16 May 2011 16:06
|
 |
|
Re: Ptr improve
By: mirek on Mon, 16 May 2011 23:13
|
 |
|
Re: Ptr improve
|
 |
|
Re: Ptr improve
By: tojocky on Wed, 18 May 2011 13:12
|
 |
|
Re: Ptr improve
|
 |
|
Re: Ptr improve
By: tojocky on Fri, 20 May 2011 08:32
|
 |
|
Re: Ptr improve
|
 |
|
Re: Ptr improve
|
 |
|
Re: Ptr improve
|
 |
|
Re: Ptr improve
By: mirek on Fri, 20 May 2011 13:19
|
 |
|
Re: Ptr improve
|
 |
|
Re: Ptr improve
|
 |
|
Re: Ptr improve
|
 |
|
Re: Ptr improve
|
 |
|
Re: Ptr improve
|
 |
|
Re: Ptr improve
By: mirek on Mon, 23 May 2011 22:37
|
 |
|
Re: Ptr improve
|
 |
|
Re: Ptr improve
|
 |
|
Re: Ptr improve
By: mirek on Tue, 24 May 2011 17:46
|
 |
|
Re: Ptr improve
By: mr_ped on Tue, 24 May 2011 18:28
|
 |
|
Re: Ptr improve
|
 |
|
Re: Ptr improve
By: mirek on Sat, 28 May 2011 20:57
|
 |
|
Re: Ptr improve
By: mr_ped on Wed, 25 May 2011 09:34
|
 |
|
Re: Ptr improve
|
 |
|
Re: Ptr improve
|
 |
|
Re: Ptr improve
|
 |
|
Re: Ptr improve
By: mirek on Sat, 28 May 2011 21:10
|
Goto Forum:
Current Time: Wed Apr 30 03:39:36 CEST 2025
Total time taken to generate the page: 0.03786 seconds
|