Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71163 - in trunk: boost/mpl libs/mpl/test
From: joel.falcou_at_[hidden]
Date: 2011-04-10 07:27:56


Author: jfalcou
Date: 2011-04-10 07:27:54 EDT (Sun, 10 Apr 2011)
New Revision: 71163
URL: http://svn.boost.org/trac/boost/changeset/71163

Log:
mpl::always is now nullary. Test is updated to take care of new possible calls using apply and apply0.
 

Text files modified:
   trunk/boost/mpl/always.hpp | 7 +++----
   trunk/libs/mpl/test/always.cpp | 10 ++++++++--
   2 files changed, 11 insertions(+), 6 deletions(-)

Modified: trunk/boost/mpl/always.hpp
==============================================================================
--- trunk/boost/mpl/always.hpp (original)
+++ trunk/boost/mpl/always.hpp 2011-04-10 07:27:54 EDT (Sun, 10 Apr 2011)
@@ -14,7 +14,7 @@
 // $Date$
 // $Revision$
 
-#include <boost/mpl/aux_/preprocessor/def_params_tail.hpp>
+#include <boost/mpl/aux_/preprocessor/default_params.hpp>
 #include <boost/mpl/aux_/na.hpp>
 #include <boost/mpl/aux_/arity_spec.hpp>
 
@@ -23,8 +23,7 @@
 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 @@
     };
 };
 
-BOOST_MPL_AUX_ARITY_SPEC(1, always)
+BOOST_MPL_AUX_ARITY_SPEC(0, always)
 
 }}
 

Modified: trunk/libs/mpl/test/always.cpp
==============================================================================
--- trunk/libs/mpl/test/always.cpp (original)
+++ trunk/libs/mpl/test/always.cpp 2011-04-10 07:27:54 EDT (Sun, 10 Apr 2011)
@@ -22,6 +22,8 @@
 {
     typedef always<true_> 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()
 {
     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 );


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk