[SVN r82706]
This commit is contained in:
Ion Gaztañaga
2013-02-03 20:42:26 +00:00
parent 81e1253a50
commit a7091d1009
2 changed files with 16 additions and 7 deletions

View File

@@ -18,6 +18,20 @@
#include <boost/move/detail/config_begin.hpp>
#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 <boost/move/detail/meta_utils.hpp>
@@ -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<TYPE>&() \
{ return *static_cast< ::boost::rv<TYPE>* >(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.

View File

@@ -108,7 +108,6 @@ int main()
movable m2(boost::move(m));
movable m3(move_return_function2());
}
//limitations_test();
return 0;
}