From c4bd007098953549689dc5177430e6a3b894d878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Wed, 17 Sep 2014 23:33:08 +0200 Subject: [PATCH] Move "forward_type" to core.hpp --- include/boost/move/core.hpp | 20 ++++++++++++++++++++ include/boost/move/traits.hpp | 12 ------------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/include/boost/move/core.hpp b/include/boost/move/core.hpp index 40a257f..ce14b1b 100644 --- a/include/boost/move/core.hpp +++ b/include/boost/move/core.hpp @@ -254,6 +254,19 @@ private:\ // + namespace boost{ + namespace move_detail{ + + template< class T> + struct forward_type + { typedef const T &type; }; + + template< class T> + struct forward_type< boost::rv > + { typedef T type; }; + + }} + #else //BOOST_NO_CXX11_RVALUE_REFERENCES //Compiler workaround detection @@ -437,6 +450,13 @@ #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 #include diff --git a/include/boost/move/traits.hpp b/include/boost/move/traits.hpp index 0ec5d4a..66d0dd6 100644 --- a/include/boost/move/traits.hpp +++ b/include/boost/move/traits.hpp @@ -70,18 +70,6 @@ struct is_nothrow_move_constructible_or_uncopyable // 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 > - { typedef T type; }; -#endif // #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - template< class T > struct is_rvalue_reference : ::boost::move_detail::integral_constant { }; #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES template< class T > struct is_rvalue_reference< T&& > : ::boost::move_detail::integral_constant { };