Remove reliance on deprecated type_traits headers. Fixed apply test.

This commit is contained in:
Edward Diener
2015-04-02 07:54:36 -04:00
parent 82e81345f2
commit 90951ea9e4
2 changed files with 11 additions and 8 deletions

View File

@@ -17,12 +17,10 @@
#include <boost/mpl/bool.hpp>
#include <boost/mpl/aux_/config/msvc.hpp>
#include <boost/mpl/aux_/config/workaround.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
#include <boost/type_traits/is_empty.hpp>
// should be always the last #include directive
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost { namespace mpl {
// empty base class, guaranteed to have no members; inheritance from
@@ -51,9 +49,14 @@ struct is_empty_base<empty_base>
}}
namespace boost {
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_empty, mpl::empty_base, true)
template<> struct is_empty< mpl::empty_base >
: public ::boost::integral_constant<bool,true>
{
public:
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,is_empty,(mpl::empty_base))
};
}
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_MPL_EMPTY_BASE_HPP_INCLUDED

View File

@@ -76,7 +76,7 @@ MPL_TEST_CASE()
typedef apply1< _1, std_vector<_1> >::type v_lambda;
typedef apply1<v_lambda,int>::type v_int;
MPL_ASSERT(( is_same< v,std_vector<int> > ));
MPL_ASSERT(( is_same< v_int,std_vector<int> > ));
}
MPL_TEST_CASE()
@@ -86,7 +86,7 @@ MPL_TEST_CASE()
typedef apply1< lambda<_1>, std_vector<_1> >::type make_vector;
typedef apply_wrap1< make_vector,int >::type v_int;
MPL_ASSERT(( is_same< v,std_vector<int> > ));
MPL_ASSERT(( is_same< v_int,std_vector<int> > ));
}
MPL_TEST_CASE()