From 7c5e478432e99f304e0ea9c03ef16f289592a5e9 Mon Sep 17 00:00:00 2001 From: Gary Furnish Date: Sun, 20 Aug 2017 21:56:52 -0600 Subject: [PATCH] Fix autoptr/unique_ptr ifdef for VS2017. --- include/boost/python/make_constructor.hpp | 4 ++-- include/boost/python/object/make_ptr_instance.hpp | 2 +- include/boost/python/object/pointer_holder.hpp | 4 ++-- include/boost/python/object/py_function.hpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/boost/python/make_constructor.hpp b/include/boost/python/make_constructor.hpp index 053d050c..3ec9ad5f 100644 --- a/include/boost/python/make_constructor.hpp +++ b/include/boost/python/make_constructor.hpp @@ -45,7 +45,7 @@ namespace detail template void dispatch(U* x, detail::true_) const { -#if __cplusplus < 201103L +#if defined(BOOST_NO_CXX11_SMART_PTR) std::auto_ptr owner(x); dispatch(owner, detail::false_()); #else @@ -63,7 +63,7 @@ namespace detail void* memory = holder::allocate(this->m_self, offsetof(instance_t, storage), sizeof(holder)); try { -#if __cplusplus < 201103L +#if defined(BOOST_NO_CXX11_SMART_PTR) (new (memory) holder(x))->install(this->m_self); #else (new (memory) holder(std::move(x)))->install(this->m_self); diff --git a/include/boost/python/object/make_ptr_instance.hpp b/include/boost/python/object/make_ptr_instance.hpp index 21089c6b..66a8bebe 100644 --- a/include/boost/python/object/make_ptr_instance.hpp +++ b/include/boost/python/object/make_ptr_instance.hpp @@ -21,7 +21,7 @@ struct make_ptr_instance template static inline Holder* construct(void* storage, PyObject*, Arg& x) { -#if __cplusplus < 201103L +#if defined(BOOST_NO_CXX11_SMART_PTR) return new (storage) Holder(x); #else return new (storage) Holder(std::move(x)); diff --git a/include/boost/python/object/pointer_holder.hpp b/include/boost/python/object/pointer_holder.hpp index c5caefe6..c3b57e83 100644 --- a/include/boost/python/object/pointer_holder.hpp +++ b/include/boost/python/object/pointer_holder.hpp @@ -106,7 +106,7 @@ struct pointer_holder_back_reference : instance_holder template inline pointer_holder::pointer_holder(Pointer p) -#if __cplusplus < 201103L +#if defined(BOOST_NO_CXX11_SMART_PTR) : m_p(p) #else : m_p(std::move(p)) @@ -116,7 +116,7 @@ inline pointer_holder::pointer_holder(Pointer p) template inline pointer_holder_back_reference::pointer_holder_back_reference(Pointer p) -#if __cplusplus < 201103L +#if defined(BOOST_NO_CXX11_SMART_PTR) : m_p(p) #else : m_p(std::move(p)) diff --git a/include/boost/python/object/py_function.hpp b/include/boost/python/object/py_function.hpp index 05cedfa0..df2fb44a 100644 --- a/include/boost/python/object/py_function.hpp +++ b/include/boost/python/object/py_function.hpp @@ -135,7 +135,7 @@ struct py_function {} py_function(py_function const& rhs) -#if __cplusplus < 201103L +#if defined(BOOST_NO_CXX11_SMART_PTR) : m_impl(rhs.m_impl) #else : m_impl(std::move(rhs.m_impl)) @@ -168,7 +168,7 @@ struct py_function } private: -#if __cplusplus < 201103L +#if defined(BOOST_NO_CXX11_SMART_PTR) mutable std::auto_ptr m_impl; #else mutable std::unique_ptr m_impl;