2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-21 17:12:22 +00:00
Files
python/pyste/example/smart_ptr.h
Bruno da Silva de Oliveira f102c77fa2 no message
[SVN r18056]
2003-03-22 18:18:25 +00:00

23 lines
404 B
C++

#include <memory>
#include <boost/shared_ptr.hpp>
namespace smart_ptr {
struct C
{
int value;
};
boost::shared_ptr<C> NewC() { return boost::shared_ptr<C>( new C() ); }
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> NewD() { return std::auto_ptr<D>( new D() ); }
}