From 92e31e84e245074c9c77f1fa0e320c0b12121467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Sat, 18 May 2013 10:40:55 +0000 Subject: [PATCH] Container, Interprocess, Intrusive, Move merge for 1.54 [SVN r84341] --- include/boost/move/core.hpp | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/include/boost/move/core.hpp b/include/boost/move/core.hpp index b900e83..d939f03 100644 --- a/include/boost/move/core.hpp +++ b/include/boost/move/core.hpp @@ -18,6 +18,21 @@ #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;\ + private:\ + // +#endif //BOOST_NO_CXX11_DELETED_FUNCTIONS + #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED) #include @@ -152,9 +167,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 +223,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. @@ -228,6 +239,8 @@ // #endif //#if !defined(BOOST_MOVE_DOXYGEN_INVOKED) + namespace boost { + //!This trait yields to a compile-time true boolean if T was marked as //!BOOST_MOVABLE_BUT_NOT_COPYABLE or BOOST_COPYABLE_AND_MOVABLE and //!rvalue references are not available on the platform. False otherwise. @@ -237,6 +250,8 @@ static const bool value = false; }; + } //namespace boost{ + //!This macro is used to achieve portable syntax in move //!constructors and assignments for classes marked as //!BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE @@ -299,7 +314,7 @@ // #define BOOST_COPY_ASSIGN_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\ - TYPE& \ + const TYPE& \ // #define BOOST_CATCH_CONST_RLVALUE(TYPE)\