Move "forward_type" to core.hpp

This commit is contained in:
Ion Gaztañaga
2014-09-17 23:33:08 +02:00
parent d4d08ec10e
commit c4bd007098
2 changed files with 20 additions and 12 deletions

View File

@@ -254,6 +254,19 @@
private:\ private:\
// //
namespace boost{
namespace move_detail{
template< class T>
struct forward_type
{ typedef const T &type; };
template< class T>
struct forward_type< boost::rv<T> >
{ typedef T type; };
}}
#else //BOOST_NO_CXX11_RVALUE_REFERENCES #else //BOOST_NO_CXX11_RVALUE_REFERENCES
//Compiler workaround detection //Compiler workaround detection
@@ -437,6 +450,13 @@
#endif //!defined(BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG) || defined(BOOST_MOVE_DOXYGEN_INVOKED) #endif //!defined(BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG) || defined(BOOST_MOVE_DOXYGEN_INVOKED)
namespace boost {
namespace move_detail {
template< class T> struct forward_type { typedef T type; };
}}
#endif //BOOST_NO_CXX11_RVALUE_REFERENCES #endif //BOOST_NO_CXX11_RVALUE_REFERENCES
#include <boost/move/detail/config_end.hpp> #include <boost/move/detail/config_end.hpp>

View File

@@ -70,18 +70,6 @@ struct is_nothrow_move_constructible_or_uncopyable
// Code from Jeffrey Lee Hellrung, many thanks // Code from Jeffrey Lee Hellrung, many thanks
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template< class T> struct forward_type { typedef T type; };
#else // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template< class T>
struct forward_type
{ typedef const T &type; };
template< class T>
struct forward_type< boost::rv<T> >
{ typedef T type; };
#endif // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template< class T > struct is_rvalue_reference : ::boost::move_detail::integral_constant<bool, false> { }; template< class T > struct is_rvalue_reference : ::boost::move_detail::integral_constant<bool, false> { };
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template< class T > struct is_rvalue_reference< T&& > : ::boost::move_detail::integral_constant<bool, true> { }; template< class T > struct is_rvalue_reference< T&& > : ::boost::move_detail::integral_constant<bool, true> { };