Modify

Opened 10 years ago

Last modified 7 years ago

#1913 new Feature Requests

Null deleter for shared_ptr

Reported by: Kevin Martin <kev82@…> Owned by: Peter Dimov
Milestone: To Be Determined Component: smart_ptr
Version: Boost 1.35.0 Severity: Cosmetic
Keywords: smart_ptr null deleter Cc:

Description

As raised in this (http://article.gmane.org/gmane.comp.lib.boost.user/35693) message on the boost-users mailing list, it would be very nice if the smart pointer library contained a null deleter object so it could be used for stack/static objects. To save the user having to define their own.

Attachments (1)

PATCH.null_deleter.diff (5.7 KB) - added by Carsten Neumann <carsten_neumann@…> 5 years ago.
makes null_deleter available from boost/smart_ptr/null_deleter.hpp, minimal docs & test case

Download all attachments as: .zip

Change History (5)

comment:1 Changed 9 years ago by Peter Dimov

Milestone: Boost 1.36.0Boost 1.37.0
Status: newassigned

comment:2 Changed 9 years ago by Peter Dimov

Milestone: Boost 1.37.0To Be Determined

comment:3 Changed 7 years ago by Peter Dimov

Status: assignednew

comment:4 Changed 7 years ago by cashcow_2@…

This ticket is raised against version 1.35.0 At least in 1.42 there is one hidden away in boost::serialization. It is difficult to know though why it is there:

#include <boost/serialization/shared_ptr.hpp>

class Foo

{

int x;

};

Foo foo; boost::shared_ptr<Foo> sharedfoo( &foo, boost::serialization::null_deleter() );

Changed 5 years ago by Carsten Neumann <carsten_neumann@…>

Attachment: PATCH.null_deleter.diff added

makes null_deleter available from boost/smart_ptr/null_deleter.hpp, minimal docs & test case

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Peter Dimov.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.