Remove non-move dependencies from headers to speed up compilations and avoid too many dependencies

This commit is contained in:
Ion Gaztañaga
2014-09-17 18:37:41 +02:00
parent 8539131b2a
commit d4d08ec10e
2 changed files with 28 additions and 428 deletions
+21 -35
View File
@@ -13,28 +13,14 @@
#define BOOST_MOVE_MOVE_HELPERS_HPP
#include <boost/move/utility.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/move/utility.hpp>
#include <boost/move/traits.hpp>
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || (defined(_MSC_VER) && (_MSC_VER == 1600))
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/utility/enable_if.hpp>
#endif
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#include <boost/mpl/if.hpp>
#endif
#include <boost/move/detail/meta_utils.hpp>
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
struct not_a_type;
struct not_a_type2;
#define BOOST_MOVE_CATCH_CONST(U) \
typename ::boost::mpl::if_< ::boost::is_class<U>, BOOST_CATCH_CONST_RLVALUE(U), const U &>::type
typename ::boost::move_detail::if_< ::boost::move_detail::is_class_or_union<U>, BOOST_CATCH_CONST_RLVALUE(U), const U &>::type
#define BOOST_MOVE_CATCH_RVALUE(U)\
typename ::boost::mpl::if_< ::boost::is_class<U>, BOOST_RV_REF(U), not_a_type>::type
typename ::boost::move_detail::if_< ::boost::move_detail::is_class_or_union<U>, BOOST_RV_REF(U), ::boost::move_detail::nat>::type
#define BOOST_MOVE_CATCH_FWD(U) BOOST_FWD_REF(U)
#else
#define BOOST_MOVE_CATCH_CONST(U) const U &
@@ -54,19 +40,19 @@ struct not_a_type2;
{ return FWD_FUNCTION(const_cast<const TYPE &>(x)); }\
\
template<class BOOST_MOVE_TEMPL_PARAM>\
typename ::boost::enable_if_c\
< ::boost::is_class<TYPE>::value &&\
::boost::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value &&\
typename ::boost::move_detail::enable_if_c\
< ::boost::move_detail::is_class_or_union<TYPE>::value &&\
::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value &&\
!::boost::has_move_emulation_enabled<BOOST_MOVE_TEMPL_PARAM>::value\
, RETURN_VALUE >::type\
PUB_FUNCTION(const BOOST_MOVE_TEMPL_PARAM &u)\
{ return FWD_FUNCTION(u); }\
\
template<class BOOST_MOVE_TEMPL_PARAM>\
typename ::boost::enable_if_c\
< (!::boost::is_class<BOOST_MOVE_TEMPL_PARAM>::value || \
typename ::boost::move_detail::enable_if_c\
< (!::boost::move_detail::is_class_or_union<BOOST_MOVE_TEMPL_PARAM>::value || \
!::boost::move_detail::is_rv<BOOST_MOVE_TEMPL_PARAM>::value) && \
!::boost::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value \
!::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value \
, RETURN_VALUE >::type\
PUB_FUNCTION(const BOOST_MOVE_TEMPL_PARAM &u)\
{\
@@ -74,7 +60,7 @@ struct not_a_type2;
return FWD_FUNCTION(::boost::move(t));\
}\
//
// ::boost::is_convertible<BOOST_MOVE_TEMPL_PARAM, TYPE>::value &&
#elif (defined(_MSC_VER) && (_MSC_VER == 1600))
#define BOOST_MOVE_CONVERSION_AWARE_CATCH(PUB_FUNCTION, TYPE, RETURN_VALUE, FWD_FUNCTION)\
@@ -85,8 +71,8 @@ struct not_a_type2;
{ return FWD_FUNCTION(::boost::move(x)); }\
\
template<class BOOST_MOVE_TEMPL_PARAM>\
typename ::boost::enable_if_c\
< !::boost::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value\
typename ::boost::move_detail::enable_if_c\
< !::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value\
, RETURN_VALUE >::type\
PUB_FUNCTION(const BOOST_MOVE_TEMPL_PARAM &u)\
{\
@@ -121,18 +107,18 @@ struct not_a_type2;
{ return FWD_FUNCTION(arg1, const_cast<const TYPE &>(x)); }\
\
template<class BOOST_MOVE_TEMPL_PARAM>\
typename ::boost::enable_if_c<\
::boost::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value &&\
typename ::boost::move_detail::enable_if_c<\
::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value &&\
!::boost::has_move_emulation_enabled<BOOST_MOVE_TEMPL_PARAM>::value\
, RETURN_VALUE >::type\
PUB_FUNCTION(ARG1 arg1, const BOOST_MOVE_TEMPL_PARAM &u)\
{ return FWD_FUNCTION(arg1, u); }\
\
template<class BOOST_MOVE_TEMPL_PARAM>\
typename ::boost::enable_if_c<\
typename ::boost::move_detail::enable_if_c<\
!::boost::move_detail::is_rv<BOOST_MOVE_TEMPL_PARAM>::value && \
!::boost::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value && \
!::boost::is_convertible<BOOST_MOVE_TEMPL_PARAM, UNLESS_CONVERTIBLE_TO>::value \
!::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value && \
!::boost::move_detail::is_convertible<BOOST_MOVE_TEMPL_PARAM, UNLESS_CONVERTIBLE_TO>::value \
, RETURN_VALUE >::type\
PUB_FUNCTION(ARG1 arg1, const BOOST_MOVE_TEMPL_PARAM &u)\
{\
@@ -151,9 +137,9 @@ struct not_a_type2;
{ return FWD_FUNCTION(arg1, ::boost::move(x)); }\
\
template<class BOOST_MOVE_TEMPL_PARAM>\
typename ::boost::enable_if_c\
< !::boost::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value && \
!::boost::is_convertible<BOOST_MOVE_TEMPL_PARAM, UNLESS_CONVERTIBLE_TO>::value \
typename ::boost::move_detail::enable_if_c\
< !::boost::move_detail::is_same<TYPE, BOOST_MOVE_TEMPL_PARAM>::value && \
!::boost::move_detail::is_convertible<BOOST_MOVE_TEMPL_PARAM, UNLESS_CONVERTIBLE_TO>::value \
, RETURN_VALUE >::type\
PUB_FUNCTION(ARG1 arg1, const BOOST_MOVE_TEMPL_PARAM &u)\
{\