diff --git a/doc/refmanual/for-each.html b/doc/refmanual/for-each.html index 535678a..fa0759c 100644 --- a/doc/refmanual/for-each.html +++ b/doc/refmanual/for-each.html @@ -123,7 +123,7 @@ typedef next<in>:: Postcondition:

Equivalent to

-for_each< tranform_view<s,op> >( f );
+for_each< transform_view<s,op> >( f );
 
@@ -141,7 +141,7 @@ struct value_printer { template< typename U > void operator()(U x) { - std::cout << x << 'n'; + std::cout << x << '\n'; } }; diff --git a/doc/refmanual/list.html b/doc/refmanual/list.html index 8f6a809..e267a5a 100644 --- a/doc/refmanual/list.html +++ b/doc/refmanual/list.html @@ -142,7 +142,7 @@ of l in the same order; see

Example

 typedef list<float,double,long double> floats;
-typedef push_front<floating_types,int>::type types;
+typedef push_front<floats,int>::type types;
 
 BOOST_MPL_ASSERT(( is_same< front<types>::type, int > ));
 
diff --git a/doc/src/refmanual/list.rst b/doc/src/refmanual/list.rst index abbc93a..5de356d 100644 --- a/doc/src/refmanual/list.rst +++ b/doc/src/refmanual/list.rst @@ -102,7 +102,7 @@ Example .. parsed-literal:: typedef list floats; - typedef push_front::type types; + typedef push_front::type types; BOOST_MPL_ASSERT(( is_same< front::type, int > )); diff --git a/doc/tutorial/apply-lambda-semantics.html b/doc/tutorial/apply-lambda-semantics.html index 154ff86..2e60b55 100644 --- a/doc/tutorial/apply-lambda-semantics.html +++ b/doc/tutorial/apply-lambda-semantics.html @@ -78,7 +78,7 @@ one.

To get a detailed picture of the new apply/lambda semantics, please see the test case at -http://cvs.sourceforge.net/viewcvs.py/boost/boost/libs/mpl/test/apply.cpp?view=markup +libs/mpl/test/apply.cpp and the corresponding sections of the MPL reference manual.

diff --git a/doc/tutorial/numeric-metafunction.html b/doc/tutorial/numeric-metafunction.html index 8a6dcb4..6a78fa0 100644 --- a/doc/tutorial/numeric-metafunction.html +++ b/doc/tutorial/numeric-metafunction.html @@ -24,7 +24,7 @@ arguments of different types, and the result will yield the largest/most general of the argument types. The infrastructure allows user-defined numeric types to be freely intermixed with predefined library types. See -http://cvs.sourceforge.net/viewcvs.py/boost/boost/libs/mpl/test/numeric_ops.cpp?view=markup +libs/mpl/test/numeric_ops.cpp for an illustrative example, and the reference manual for the formal infrastructure specification.

If you were using MPL numeric metafunctions on your own integral diff --git a/dummy b/dummy new file mode 100644 index 0000000..4d6a3b4 --- /dev/null +++ b/dummy @@ -0,0 +1 @@ +ECHO is on. 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/include/boost/mpl/eval_if.hpp b/include/boost/mpl/eval_if.hpp index 442194f..e892703 100644 --- a/include/boost/mpl/eval_if.hpp +++ b/include/boost/mpl/eval_if.hpp @@ -4,8 +4,8 @@ // Copyright Aleksey Gurtovoy 2000-2004 // -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/mpl for documentation. @@ -43,7 +43,7 @@ struct eval_if BOOST_MPL_AUX_LAMBDA_SUPPORT(3,eval_if,(C,F1,F2)) }; -// (almost) copy & paste in order to save one more +// (almost) copy & paste in order to save one more // recursively nested template instantiation to user template< bool C diff --git a/include/boost/mpl/for_each.hpp b/include/boost/mpl/for_each.hpp index 1feadc9..66fd01b 100644 --- a/include/boost/mpl/for_each.hpp +++ b/include/boost/mpl/for_each.hpp @@ -108,7 +108,9 @@ template< inline void for_each(F f, Sequence* = 0) { - for_each >(f); + // jfalcou: fully qualifying this call so it doesnt clash with phoenix::for_each + // ons ome compilers -- done on 02/28/2011 + boost::mpl::for_each >(f); } }} diff --git a/include/boost/mpl/has_xxx.hpp b/include/boost/mpl/has_xxx.hpp index 379bd0c..bdca255 100644 --- a/include/boost/mpl/has_xxx.hpp +++ b/include/boost/mpl/has_xxx.hpp @@ -290,18 +290,24 @@ struct trait \ # if !defined(BOOST_MPL_HAS_XXX_NO_WRAPPED_TYPES) # if BOOST_WORKAROUND(BOOST_MSVC, <= 1400) # define BOOST_MPL_HAS_XXX_NO_WRAPPED_TYPES 1 +# else +# define BOOST_MPL_HAS_XXX_NO_WRAPPED_TYPES 0 # endif # endif # if !defined(BOOST_MPL_HAS_XXX_NO_EXPLICIT_TEST_FUNCTION) # if (defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS)) # define BOOST_MPL_HAS_XXX_NO_EXPLICIT_TEST_FUNCTION 1 +# else +# define BOOST_MPL_HAS_XXX_NO_EXPLICIT_TEST_FUNCTION 0 # endif # endif # if !defined(BOOST_MPL_HAS_XXX_NEEDS_TEMPLATE_SFINAE) # if BOOST_WORKAROUND(BOOST_MSVC, <= 1400) # define BOOST_MPL_HAS_XXX_NEEDS_TEMPLATE_SFINAE 1 +# else +# define BOOST_MPL_HAS_XXX_NEEDS_TEMPLATE_SFINAE 0 # endif # endif diff --git a/include/boost/mpl/set/aux_/item.hpp b/include/boost/mpl/set/aux_/item.hpp index 4433572..e90e490 100644 --- a/include/boost/mpl/set/aux_/item.hpp +++ b/include/boost/mpl/set/aux_/item.hpp @@ -32,7 +32,7 @@ struct s_item typedef s_item item_; typedef void_ last_masked_; typedef T item_type_; - typedef Base base; + typedef typename Base::item_ base; typedef typename next< typename Base::size >::type size; typedef typename next< typename Base::order >::type order; @@ -55,7 +55,7 @@ struct s_mask typedef s_mask item_; typedef T last_masked_; typedef void_ item_type_; - typedef Base base; + typedef typename Base::item_ base; typedef typename prior< typename Base::size >::type size; BOOST_MPL_AUX_SET_OVERLOAD( aux::yes_tag, IS_MASKED, s_mask, aux::type_wrapper* ); @@ -69,7 +69,7 @@ struct s_unmask typedef s_unmask item_; typedef void_ last_masked_; typedef T item_type_; - typedef Base base; + typedef typename Base::item_ base; typedef typename next< typename Base::size >::type size; BOOST_MPL_AUX_SET_OVERLOAD( aux::no_tag, IS_MASKED, s_unmask, aux::type_wrapper* ); 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 ); diff --git a/test/set_c.cpp b/test/set_c.cpp index 1a6e970..e34d86d 100644 --- a/test/set_c.cpp +++ b/test/set_c.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include @@ -59,6 +60,18 @@ MPL_TEST_CASE() MPL_ASSERT(( is_same< test::at_c::type, void_ > )); MPL_ASSERT(( is_same< test::at_c::type, void_ > )); #endif + + typedef begin::type first1; + typedef end::type last1; + MPL_ASSERT_RELATION( (distance::value), ==, 1 ); + + typedef begin::type first2; + typedef end::type last2; + MPL_ASSERT_RELATION( (distance::value), ==, 1 ); + + typedef begin::type first3; + typedef end::type last3; + MPL_ASSERT_RELATION( (distance::value), ==, 2 ); } #endif @@ -82,4 +95,12 @@ MPL_TEST_CASE() MPL_ASSERT(( is_same< test::at_c::type, void_ > )); MPL_ASSERT(( is_same< test::at_c::type, void_ > )); #endif + + typedef begin::type first1; + typedef end::type last1; + MPL_ASSERT_RELATION( (distance::value), ==, 1 ); + + typedef begin::type first2; + typedef end::type last2; + MPL_ASSERT_RELATION( (distance::value), ==, 8 ); }