2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-22 17:32:55 +00:00
Files
python/pyste/example/smart_ptr.h
2003-03-21 14:24:20 +00:00

21 lines
330 B
C++

#include <memory>
#include <boost/shared_ptr.hpp>
namespace smart_ptr {
struct C
{
int value;
};
struct D
{
boost::shared_ptr<C> Get() { return ptr; }
void Set( boost::shared_ptr<C> c ) { ptr = c; }
private:
boost::shared_ptr<C> ptr;
};
std::auto_ptr<D> New() { return std::auto_ptr<D>( new D() ); }
}