diff --git a/include/boost/move/core.hpp b/include/boost/move/core.hpp index b900e83..2962cc6 100644 --- a/include/boost/move/core.hpp +++ b/include/boost/move/core.hpp @@ -18,6 +18,20 @@ #include +#ifdef BOOST_NO_CXX11_DELETED_FUNCTIONS + #define BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE) \ + private:\ + TYPE(TYPE &);\ + TYPE& operator=(TYPE &);\ + // +#else + #define BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE) \ + public:\ + TYPE(TYPE const &) = delete;\ + TYPE& operator=(TYPE const &) = delete;\ + // +#endif //BOOST_NO_CXX11_DELETED_FUNCTIONS + #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED) #include @@ -152,9 +166,7 @@ // ////////////////////////////////////////////////////////////////////////////// #define BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)\ - private:\ - TYPE(TYPE &);\ - TYPE& operator=(TYPE &);\ + BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE)\ public:\ operator ::boost::rv&() \ { return *static_cast< ::boost::rv* >(this); }\ @@ -210,11 +222,9 @@ //! and assignment. The user will need to write a move constructor/assignment as explained //! in the documentation to fully write a movable but not copyable class. #define BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)\ + BOOST_MOVE_IMPL_NO_COPY_CTOR_OR_ASSIGN(TYPE)\ public:\ typedef int boost_move_emulation_t;\ - private:\ - TYPE(const TYPE &);\ - TYPE& operator=(const TYPE &);\ // //! This macro marks a type as copyable and movable. diff --git a/test/move.cpp b/test/move.cpp index e0e21f1..a48b4ef 100644 --- a/test/move.cpp +++ b/test/move.cpp @@ -108,7 +108,6 @@ int main() movable m2(boost::move(m)); movable m3(move_return_function2()); } - //limitations_test(); return 0; }