Opened 10 years ago

Closed 10 years ago

#6896 closed Feature Requests (duplicate)

Support std::shared_ptr

Reported by: Maciej Dems <maciej.dems@…> Owned by: Ralf W. Grosse-Kunstleve
Milestone: To Be Determined Component: python USE GITHUB
Version: Boost 1.49.0 Severity: Problem
Keywords: Cc: jhasse@…

Description

In C++0x standard, there is a ne0w std::shared_ptr class, which is very similar to boost::shared_ptr. As in Boost Python one can require to use boost::shared_ptr to store the object, i.e.

class_< A, boost::shared_ptr<A> >

it should be possible to use std::shared_ptr for the same purpose:

class_< A, std::shared_ptr<A> >

In the present version, the code using std::shared_ptr<A> does not compile.

However, it seems that it might be sufficient to add the following template somewhere in the headers (ifdef-ed for c++0x):

#include <memory> template<class T> inline T * get_pointer(std::shared_ptr<T> const & p) {

return p.get();

}

Change History (3)

comment:1 by Ralf W. Grosse-Kunstleve, 10 years ago

please post this feature request to c++sig. hopefully someone will pick it up.

comment:2 by Jan Niklas Hasse <jhasse@…>, 10 years ago

Cc: jhasse@… added

comment:3 by Jim Bosch, 10 years ago

Resolution: duplicate
Status: newclosed

This is a duplicate of #6545.

Note: See TracTickets for help on using tickets.