diff options
Diffstat (limited to 'boost/python/make_constructor.hpp')
-rw-r--r-- | boost/python/make_constructor.hpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/boost/python/make_constructor.hpp b/boost/python/make_constructor.hpp index 093703bb84..92a7951d35 100644 --- a/boost/python/make_constructor.hpp +++ b/boost/python/make_constructor.hpp @@ -45,8 +45,13 @@ namespace detail template <class U> void dispatch(U* x, mpl::true_) const { - std::auto_ptr<U> owner(x); - dispatch(owner, mpl::false_()); +#if __cplusplus < 201103L + std::auto_ptr<U> owner(x); + dispatch(owner, mpl::false_()); +#else + std::unique_ptr<U> owner(x); + dispatch(std::move(owner), mpl::false_()); +#endif } template <class Ptr> @@ -58,7 +63,11 @@ namespace detail void* memory = holder::allocate(this->m_self, offsetof(instance_t, storage), sizeof(holder)); try { +#if __cplusplus < 201103L (new (memory) holder(x))->install(this->m_self); +#else + (new (memory) holder(std::move(x)))->install(this->m_self); +#endif } catch(...) { holder::deallocate(this->m_self, memory); |