Merge move from trunk

[SVN r78592]
This commit is contained in:
Ion Gaztañaga
2012-05-24 17:02:29 +00:00
parent 9127a41803
commit fd7aaebd3f

View File

@@ -217,9 +217,9 @@
#if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED) #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
//Move emulation rv breaks standard aliasing rules so add workarounds for some compilers //Move emulation rv breaks standard aliasing rules so add workarounds for some compilers
#ifdef __GNUC__ #ifdef __GNUC__
#define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__)) #define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__))
#else #else
#define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS #define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS
#endif #endif
@@ -306,10 +306,10 @@
{}; {};
template <class T> template <class T>
struct has_move_emulation_enabled_aux struct has_move_emulation_enabled_aux
: has_move_emulation_enabled<T> {}; : has_move_emulation_enabled<T> {};
template <class T> template <class T>
struct has_nothrow_move struct has_nothrow_move
: public BOOST_MOVE_BOOST_NS::integral_constant<bool, false> : public BOOST_MOVE_BOOST_NS::integral_constant<bool, false>
{}; {};
@@ -319,7 +319,7 @@
// move() // move()
// //
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
template <class T> template <class T>
inline typename BOOST_MOVE_BOOST_NS::disable_if<has_move_emulation_enabled_aux<T>, T&>::type move(T& x) inline typename BOOST_MOVE_BOOST_NS::disable_if<has_move_emulation_enabled_aux<T>, T&>::type move(T& x)
{ {
@@ -460,7 +460,7 @@
//! By default this traits returns false. Classes with non-throwing move constructor //! By default this traits returns false. Classes with non-throwing move constructor
//! and assignment should specialize this trait to obtain some performance improvements. //! and assignment should specialize this trait to obtain some performance improvements.
template <class T> template <class T>
struct has_nothrow_move struct has_nothrow_move
: public BOOST_MOVE_MPL_NS::integral_constant<bool, false> : public BOOST_MOVE_MPL_NS::integral_constant<bool, false>
{}; {};
@@ -494,7 +494,7 @@
//! This function provides a way to convert a reference into a rvalue reference //! This function provides a way to convert a reference into a rvalue reference
//! in compilers with rvalue references. For other compilers converts T & into //! in compilers with rvalue references. For other compilers converts T & into
//! <i>::boost::rv<T> &</i> so that move emulation is activated. //! <i>::boost::rv<T> &</i> so that move emulation is activated.
template <class T> template <class T>
rvalue_reference move (input_reference); rvalue_reference move (input_reference);
#elif defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES) #elif defined(BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES)
@@ -508,7 +508,7 @@
template <class T> template <class T>
inline typename remove_reference<T>::type && move(T&& t) inline typename remove_reference<T>::type && move(T&& t)
{ return static_cast<typename remove_reference<T>::type &&>(t); } { return static_cast<typename remove_reference<T>::type &&>(t); }
#endif //Old move #endif //Old move
@@ -1222,7 +1222,7 @@ template< class T > struct remove_rvalue_reference { typedef T type; };
template< class T > struct remove_rvalue_reference< const rv<T>& > { typedef T type; }; template< class T > struct remove_rvalue_reference< const rv<T>& > { typedef T type; };
template< class T > struct remove_rvalue_reference< volatile rv<T>& > { typedef T type; }; template< class T > struct remove_rvalue_reference< volatile rv<T>& > { typedef T type; };
template< class T > struct remove_rvalue_reference< const volatile rv<T>& >{ typedef T type; }; template< class T > struct remove_rvalue_reference< const volatile rv<T>& >{ typedef T type; };
#endif // #ifndef BOOST_NO_RVALUE_REFERENCES #endif // #ifndef BOOST_NO_RVALUE_REFERENCES
template <typename T> template <typename T>
typename boost::move_detail::add_rvalue_reference<T>::type declval(); typename boost::move_detail::add_rvalue_reference<T>::type declval();
@@ -1230,7 +1230,7 @@ typename boost::move_detail::add_rvalue_reference<T>::type declval();
} }
// Ideas from Boost.Move review, Jeffrey Lee Hellrung: // Ideas from Boost.Move review, Jeffrey Lee Hellrung:
// //
//- TypeTraits metafunctions is_lvalue_reference, add_lvalue_reference, and remove_lvalue_reference ? //- TypeTraits metafunctions is_lvalue_reference, add_lvalue_reference, and remove_lvalue_reference ?
// Perhaps add_reference and remove_reference can be modified so that they behave wrt emulated rvalue // Perhaps add_reference and remove_reference can be modified so that they behave wrt emulated rvalue
// references the same as wrt real rvalue references, i.e., add_reference< rv<T>& > -> T& rather than // references the same as wrt real rvalue references, i.e., add_reference< rv<T>& > -> T& rather than
// rv<T>& (since T&& & -> T&). // rv<T>& (since T&& & -> T&).
@@ -1238,7 +1238,7 @@ typename boost::move_detail::add_rvalue_reference<T>::type declval();
//- Add'l TypeTraits has_[trivial_]move_{constructor,assign}...? //- Add'l TypeTraits has_[trivial_]move_{constructor,assign}...?
// //
//- An as_lvalue(T& x) function, which amounts to an identity operation in C++0x, but strips emulated //- An as_lvalue(T& x) function, which amounts to an identity operation in C++0x, but strips emulated
// rvalue references in C++03. This may be necessary to prevent "accidental moves". // rvalue references in C++03. This may be necessary to prevent "accidental moves".
} //namespace boost { } //namespace boost {