2
0
mirror of https://github.com/boostorg/python.git synced 2026-02-02 09:02:15 +00:00

better auto_ptr support

[SVN r17592]
This commit is contained in:
Dave Abrahams
2003-02-22 18:11:08 +00:00
parent b42b243287
commit acdad5caf3
5 changed files with 108 additions and 11 deletions

View File

@@ -66,10 +66,17 @@ BOOST_PYTHON_MODULE(auto_ptr_ext)
.def("value", &X::value)
;
class_<Y, std::auto_ptr<Y>, bases<X>, boost::noncopyable>("X", init<int>())
class_<Y, std::auto_ptr<Y>, bases<X>, boost::noncopyable>("Y", init<int>())
;
// VC6 auto_ptrs do not have converting constructors
#if defined(BOOST_MSVC_STD_ITERATOR)
scope().attr("broken_auto_ptr") = 1;
#else
scope().attr("broken_auto_ptr") = 0;
implicitly_convertible<std::auto_ptr<Y>, std::auto_ptr<X> >();
#endif
def("look", look);
def("steal", steal);
def("maybe_steal", maybe_steal);