Opened 14 years ago

Last modified 12 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@…> 10 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 by Peter Dimov, 14 years ago

Milestone: Boost 1.36.0Boost 1.37.0
Status: newassigned

comment:2 by Peter Dimov, 14 years ago

Milestone: Boost 1.37.0To Be Determined

comment:3 by Peter Dimov, 12 years ago

Status: assignednew

comment:4 by cashcow_2@…, 12 years ago

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() );

by Carsten Neumann <carsten_neumann@…>, 10 years ago

Attachment: PATCH.null_deleter.diff added

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

Note: See TracTickets for help on using tickets.