diff --git a/CMakeLists.txt b/CMakeLists.txt index c164cfba4..d8154b9d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.2) +CMAKE_MINIMUM_REQUIRED(VERSION 3.8) SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/" ${CMAKE_MODULE_PATH}) @@ -12,7 +12,7 @@ IF(NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) ENDIF(NOT CMAKE_BUILD_TYPE) -SET(CMAKE_CXX_STANDARD 11) +SET(CMAKE_CXX_STANDARD 17) SET(CMAKE_CXX_STANDARD_REQUIRED ON) SET(CMAKE_CXX_EXTENSIONS OFF) diff --git a/libs/luabind/luabind/class.hpp b/libs/luabind/luabind/class.hpp index 10fb8e03d..0bb5004ba 100644 --- a/libs/luabind/luabind/class.hpp +++ b/libs/luabind/luabind/class.hpp @@ -335,7 +335,7 @@ namespace luabind template struct default_pointer { - typedef std::auto_ptr type; + typedef std::unique_ptr type; }; template diff --git a/libs/luabind/luabind/detail/constructor.hpp b/libs/luabind/luabind/detail/constructor.hpp index 1cbceb789..c3fc8ba7c 100644 --- a/libs/luabind/luabind/detail/constructor.hpp +++ b/libs/luabind/luabind/detail/constructor.hpp @@ -46,7 +46,7 @@ struct construct_aux<0, T, Pointer, Signature> object_rep* self = touserdata(self_); class_rep* cls = self->crep(); - std::auto_ptr instance(new T); + std::unique_ptr instance(new T); inject_backref(self_.interpreter(), instance.get(), instance.get()); void* naked_ptr = instance.get(); @@ -55,7 +55,7 @@ struct construct_aux<0, T, Pointer, Signature> void* storage = self->allocate(sizeof(holder_type)); self->set_instance(new (storage) holder_type( - ptr, registered_class::id, naked_ptr, cls)); + std::move(ptr), registered_class::id, naked_ptr, cls)); } }; @@ -92,7 +92,7 @@ struct construct_aux object_rep* self = touserdata(self_); class_rep* cls = self->crep(); - std::auto_ptr instance(new T(BOOST_PP_ENUM_PARAMS(N,_))); + std::unique_ptr instance(new T(BOOST_PP_ENUM_PARAMS(N,_))); inject_backref(self_.interpreter(), instance.get(), instance.get()); void* naked_ptr = instance.get(); @@ -101,7 +101,7 @@ struct construct_aux void* storage = self->allocate(sizeof(holder_type)); self->set_instance(new (storage) holder_type( - ptr, registered_class::id, naked_ptr, cls)); + std::move(ptr), registered_class::id, naked_ptr, cls)); } }; diff --git a/libs/luabind/luabind/detail/has_get_pointer.hpp b/libs/luabind/luabind/detail/has_get_pointer.hpp index 8a001ddda..67d6a7639 100644 --- a/libs/luabind/luabind/detail/has_get_pointer.hpp +++ b/libs/luabind/luabind/detail/has_get_pointer.hpp @@ -58,7 +58,7 @@ namespace has_get_pointer_ T* get_pointer(T const volatile*); template - T* get_pointer(std::auto_ptr const&); + T* get_pointer(std::unique_ptr const&); # endif diff --git a/libs/luabind/luabind/detail/instance_holder.hpp b/libs/luabind/luabind/detail/instance_holder.hpp index 456e13e6b..2c1d5d955 100644 --- a/libs/luabind/luabind/detail/instance_holder.hpp +++ b/libs/luabind/luabind/detail/instance_holder.hpp @@ -57,7 +57,7 @@ inline mpl::true_ check_const_pointer(void const*) } template -void release_ownership(std::auto_ptr& p) +void release_ownership(std::unique_ptr& p) { p.release(); } @@ -83,7 +83,7 @@ public: P p, class_id dynamic_id, void* dynamic_ptr, class_rep* cls ) : instance_holder(cls, check_const_pointer(false ? get_pointer(p) : 0)) - , p(p) + , p(std::move(p)) , weak(0) , dynamic_id(dynamic_id) , dynamic_ptr(dynamic_ptr) diff --git a/libs/luabind/luabind/detail/make_instance.hpp b/libs/luabind/luabind/detail/make_instance.hpp index 3150cf048..66d23fbd8 100644 --- a/libs/luabind/luabind/detail/make_instance.hpp +++ b/libs/luabind/luabind/detail/make_instance.hpp @@ -88,7 +88,7 @@ void make_instance(lua_State* L, P p) try { - new (storage) holder_type(p, dynamic.first, dynamic.second, cls); + new (storage) holder_type(std::move(p), dynamic.first, dynamic.second, cls); } catch (...) { diff --git a/libs/luabind/luabind/detail/policy.hpp b/libs/luabind/luabind/detail/policy.hpp index 79577c9a4..ec29d2ab8 100644 --- a/libs/luabind/luabind/detail/policy.hpp +++ b/libs/luabind/luabind/detail/policy.hpp @@ -180,8 +180,8 @@ namespace luabind { namespace detail template void make_pointee_instance(lua_State* L, T& x, mpl::false_, mpl::true_) { - std::auto_ptr ptr(new T(x)); - make_instance(L, ptr); + std::unique_ptr ptr(new T(x)); + make_instance(L, std::move(ptr)); } template diff --git a/libs/luabind/luabind/function.hpp b/libs/luabind/luabind/function.hpp index e156fbfcb..b93ca2627 100644 --- a/libs/luabind/luabind/function.hpp +++ b/libs/luabind/luabind/function.hpp @@ -46,7 +46,7 @@ namespace detail template scope def(char const* name, F f, Policies const& policies) { - return scope(std::auto_ptr( + return scope(std::unique_ptr( new detail::function_registration(name, f, policies))); } diff --git a/libs/luabind/luabind/scope.hpp b/libs/luabind/luabind/scope.hpp index 3b5f293bf..e2cfaed36 100644 --- a/libs/luabind/luabind/scope.hpp +++ b/libs/luabind/luabind/scope.hpp @@ -56,7 +56,7 @@ namespace luabind { struct LUABIND_API scope { scope(); - explicit scope(std::auto_ptr reg); + explicit scope(std::unique_ptr reg); scope(scope const& other_); ~scope(); diff --git a/libs/luabind/src/class.cpp b/libs/luabind/src/class.cpp index 8a67cf6f3..f42b9a8c0 100644 --- a/libs/luabind/src/class.cpp +++ b/libs/luabind/src/class.cpp @@ -235,7 +235,7 @@ namespace luabind { namespace detail { // -- interface --------------------------------------------------------- class_base::class_base(char const* name) - : scope(std::auto_ptr( + : scope(std::unique_ptr( m_registration = new class_registration(name)) ) { @@ -258,14 +258,14 @@ namespace luabind { namespace detail { void class_base::add_member(registration* member) { - std::auto_ptr ptr(member); - m_registration->m_members.operator,(scope(ptr)); + std::unique_ptr ptr(member); + m_registration->m_members.operator,(scope(std::move(ptr))); } void class_base::add_default_member(registration* member) { - std::auto_ptr ptr(member); - m_registration->m_default_members.operator,(scope(ptr)); + std::unique_ptr ptr(member); + m_registration->m_default_members.operator,(scope(std::move(ptr))); } const char* class_base::name() const diff --git a/libs/luabind/src/scope.cpp b/libs/luabind/src/scope.cpp index 52bd132f9..0cdd53005 100644 --- a/libs/luabind/src/scope.cpp +++ b/libs/luabind/src/scope.cpp @@ -49,7 +49,7 @@ namespace luabind { namespace detail { { } - scope::scope(std::auto_ptr reg) + scope::scope(std::unique_ptr reg) : m_chain(reg.release()) { } @@ -193,7 +193,7 @@ namespace luabind { }; namespace_::namespace_(char const* name) - : scope(std::auto_ptr( + : scope(std::unique_ptr( m_registration = new registration_(name))) { }