diff --git a/include/boost/mpl/always.hpp b/include/boost/mpl/always.hpp index 722c4b3..5fe7132 100644 --- a/include/boost/mpl/always.hpp +++ b/include/boost/mpl/always.hpp @@ -14,7 +14,7 @@ // $Date$ // $Revision$ -#include +#include #include #include @@ -23,8 +23,7 @@ namespace boost { namespace mpl { template< typename Value > struct always { template< - typename T - BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(1, typename T, na) + BOOST_MPL_PP_DEFAULT_PARAMS(BOOST_MPL_LIMIT_METAFUNCTION_ARITY, typename T, na) > struct apply { @@ -32,7 +31,7 @@ template< typename Value > struct always }; }; -BOOST_MPL_AUX_ARITY_SPEC(1, always) +BOOST_MPL_AUX_ARITY_SPEC(0, always) }} diff --git a/test/always.cpp b/test/always.cpp index 7a93615..53294b1 100644 --- a/test/always.cpp +++ b/test/always.cpp @@ -22,6 +22,8 @@ MPL_TEST_CASE() { typedef always always_true; + MPL_ASSERT(( apply< always_true > )); + MPL_ASSERT(( apply0< always_true > )); MPL_ASSERT(( apply1< always_true,false_ > )); MPL_ASSERT(( apply2< always_true,false_,false_ > )); MPL_ASSERT(( apply3< always_true,false_,false_,false_ > )); @@ -31,11 +33,15 @@ MPL_TEST_CASE() MPL_TEST_CASE() { typedef always< int_<10> > always_10; - + + typedef apply< always_10 >::type res; + typedef apply0< always_10 >::type res0; typedef apply1< always_10,int_<0> >::type res1; typedef apply2< always_10,int_<0>,int_<0> >::type res2; typedef apply3< always_10,int_<0>,int_<0>,int_<0> >::type res3; - + + MPL_ASSERT_RELATION( res::value, ==, 10 ); + MPL_ASSERT_RELATION( res0::value, ==, 10 ); MPL_ASSERT_RELATION( res1::value, ==, 10 ); MPL_ASSERT_RELATION( res2::value, ==, 10 ); MPL_ASSERT_RELATION( res3::value, ==, 10 );