merge new MPL version from 'mplbook' branch

[SVN r24874]
This commit is contained in:
Aleksey Gurtovoy
2004-09-02 15:41:37 +00:00
parent 4e07575b78
commit 6196a6e591
12 changed files with 47 additions and 44 deletions

View File

@ -10,7 +10,7 @@
# include <boost/mpl/bool.hpp>
# include <boost/mpl/if.hpp>
# include <boost/mpl/identity.hpp>
# include <boost/mpl/apply_if.hpp>
# include <boost/mpl/eval_if.hpp>
namespace boost {
@ -83,7 +83,7 @@ namespace detail
{
typedef typename detail::ia_dflt_help<
CategoryOrTraversal
, mpl::apply_if<
, mpl::eval_if<
is_numeric<Incrementable>
, mpl::identity<random_access_traversal_tag>
, iterator_traversal<Incrementable>
@ -92,7 +92,7 @@ namespace detail
typedef typename detail::ia_dflt_help<
Difference
, mpl::apply_if<
, mpl::eval_if<
is_numeric<Incrementable>
, numeric_difference<Incrementable>
, iterator_difference<Incrementable>

View File

@ -11,7 +11,7 @@
# include <boost/mpl/or.hpp> // used in iterator_tag inheritance logic
# include <boost/mpl/and.hpp>
# include <boost/mpl/if.hpp>
# include <boost/mpl/apply_if.hpp>
# include <boost/mpl/eval_if.hpp>
# include <boost/mpl/identity.hpp>
# include <boost/type_traits/is_same.hpp>
@ -86,12 +86,12 @@ struct iterator_writability_disabled
//
template <class Traversal, class ValueParam, class Reference>
struct iterator_facade_default_category
: mpl::apply_if<
: mpl::eval_if<
mpl::and_<
is_reference<Reference>
, is_convertible<Traversal,forward_traversal_tag>
>
, mpl::apply_if<
, mpl::eval_if<
is_convertible<Traversal,random_access_traversal_tag>
, mpl::identity<std::random_access_iterator_tag>
, mpl::if_<
@ -100,7 +100,7 @@ struct iterator_facade_default_category
, std::forward_iterator_tag
>
>
, typename mpl::apply_if<
, typename mpl::eval_if<
mpl::and_<
is_convertible<Traversal, single_pass_traversal_tag>
@ -194,7 +194,7 @@ struct facade_iterator_category_impl
//
template <class CategoryOrTraversal, class ValueParam, class Reference>
struct facade_iterator_category
: mpl::apply_if<
: mpl::eval_if<
is_iterator_category<CategoryOrTraversal>
, mpl::identity<CategoryOrTraversal> // old-style categories are fine as-is
, facade_iterator_category_impl<CategoryOrTraversal,ValueParam,Reference>

View File

@ -99,6 +99,8 @@ struct minimum_category<mpl::_1,mpl::_2>
template <class T1, class T2>
struct apply : minimum_category<T1,T2>
{};
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2,minimum_category,(mpl::_1,mpl::_2))
};
# if BOOST_WORKAROUND(BOOST_MSVC, == 1200) // ETI workaround

View File

@ -21,11 +21,11 @@
#include <boost/mpl/bool.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/apply_if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/aux_/has_xxx.hpp>
#include <boost/mpl/has_xxx.hpp>
#ifdef BOOST_MPL_NO_AUX_HAS_XXX
#ifdef BOOST_MPL_CFG_NO_HAS_XXX
# include <boost/shared_ptr.hpp>
# include <boost/scoped_ptr.hpp>
# include <boost/mpl/bool.hpp>
@ -55,7 +55,7 @@ namespace boost
, Category
, typename ia_dflt_help<
Reference
, mpl::apply_if<
, mpl::eval_if<
is_same<Value,use_default>
, indirect_reference<dereferenceable>
, add_reference<Value>

View File

@ -159,7 +159,7 @@ namespace boost
// DefaultNullaryFn, otherwise return T.
template <class T, class DefaultNullaryFn>
struct ia_dflt_help
: mpl::apply_if<
: mpl::eval_if<
is_same<T, use_default>
, DefaultNullaryFn
, mpl::identity<T>
@ -185,7 +185,7 @@ namespace boost
# ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY
, typename detail::ia_dflt_help<
Value
, mpl::apply_if<
, mpl::eval_if<
is_same<Reference,use_default>
, iterator_value<Base>
, remove_reference<Reference>
@ -204,7 +204,7 @@ namespace boost
, typename detail::ia_dflt_help<
Reference
, mpl::apply_if<
, mpl::eval_if<
is_same<Value,use_default>
, iterator_reference<Base>
, add_reference<Value>

View File

@ -25,7 +25,7 @@
#include <boost/mpl/int.hpp>
#include <boost/mpl/equal_to.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/apply_if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/identity.hpp>
@ -120,9 +120,9 @@ namespace detail
template <class Value, class AccessCategory, class TraversalCategory>
struct operator_brackets
: mpl::aux::msvc_eti_base<
typename mpl::apply_if<
typename mpl::eval_if<
is_convertible<TraversalCategory, random_access_traversal_tag>
, mpl::apply_if<
, mpl::eval_if<
iterator_archetypes::has_access<
AccessCategory
, iterator_archetypes::writable_iterator_t
@ -417,7 +417,7 @@ namespace detail
typedef typename detail::facade_iterator_category<
TraversalCategory
, typename mpl::apply_if<
, typename mpl::eval_if<
iterator_archetypes::has_access<
AccessCategory, iterator_archetypes::writable_iterator_t
>

View File

@ -12,7 +12,7 @@
# include <boost/detail/workaround.hpp>
# include <boost/mpl/apply_if.hpp>
# include <boost/mpl/eval_if.hpp>
# include <boost/mpl/identity.hpp>
# include <boost/mpl/placeholders.hpp>
# include <boost/mpl/aux_/lambda_support.hpp>
@ -74,19 +74,19 @@ namespace detail
//
template <class Cat>
struct old_category_to_traversal
: mpl::apply_if<
: mpl::eval_if<
is_convertible<Cat,std::random_access_iterator_tag>
, mpl::identity<random_access_traversal_tag>
, mpl::apply_if<
, mpl::eval_if<
is_convertible<Cat,std::bidirectional_iterator_tag>
, mpl::identity<bidirectional_traversal_tag>
, mpl::apply_if<
, mpl::eval_if<
is_convertible<Cat,std::forward_iterator_tag>
, mpl::identity<forward_traversal_tag>
, mpl::apply_if<
, mpl::eval_if<
is_convertible<Cat,std::input_iterator_tag>
, mpl::identity<single_pass_traversal_tag>
, mpl::apply_if<
, mpl::eval_if<
is_convertible<Cat,std::output_iterator_tag>
, mpl::identity<incrementable_traversal_tag>
, void
@ -107,19 +107,19 @@ namespace detail
template <class Traversal>
struct pure_traversal_tag
: mpl::apply_if<
: mpl::eval_if<
is_convertible<Traversal,random_access_traversal_tag>
, mpl::identity<random_access_traversal_tag>
, mpl::apply_if<
, mpl::eval_if<
is_convertible<Traversal,bidirectional_traversal_tag>
, mpl::identity<bidirectional_traversal_tag>
, mpl::apply_if<
, mpl::eval_if<
is_convertible<Traversal,forward_traversal_tag>
, mpl::identity<forward_traversal_tag>
, mpl::apply_if<
, mpl::eval_if<
is_convertible<Traversal,single_pass_traversal_tag>
, mpl::identity<single_pass_traversal_tag>
, mpl::apply_if<
, mpl::eval_if<
is_convertible<Traversal,incrementable_traversal_tag>
, mpl::identity<incrementable_traversal_tag>
, void
@ -147,7 +147,7 @@ namespace detail
//
template <class Cat>
struct iterator_category_to_traversal
: mpl::apply_if< // if already convertible to a traversal tag, we're done.
: mpl::eval_if< // if already convertible to a traversal tag, we're done.
is_convertible<Cat,incrementable_traversal_tag>
, mpl::identity<Cat>
, detail::old_category_to_traversal<Cat>
@ -162,7 +162,7 @@ struct iterator_traversal
>
{};
# ifdef BOOST_MPL_NO_FULL_LAMBDA_SUPPORT
# ifdef BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT
// Hack because BOOST_MPL_AUX_LAMBDA_SUPPORT doesn't seem to work
// out well. Instantiating the nested apply template also
// requires instantiating iterator_traits on the

View File

@ -31,6 +31,7 @@
// Use boost/limits to work around missing limits headers on some compilers
#include <boost/limits.hpp>
#include <boost/config.hpp>
#include <algorithm>

View File

@ -24,7 +24,7 @@
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_pod.hpp>
#include <boost/mpl/apply_if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/and.hpp>
@ -104,7 +104,7 @@ namespace boost
typedef typename remove_const<ValueParam>::type value_type;
typedef typename mpl::apply_if<
typedef typename mpl::eval_if<
detail::iterator_writability_disabled<ValueParam,Reference>
, add_pointer<typename add_const<value_type>::type>
, add_pointer<value_type>
@ -267,7 +267,7 @@ namespace boost
// *r also returns a proxy.
template <class Iterator, class Value, class Reference, class CategoryOrTraversal>
struct postfix_increment_result
: mpl::apply_if<
: mpl::eval_if<
mpl::and_<
// A proxy is only needed for readable iterators
is_convertible<Reference,Value>
@ -416,7 +416,7 @@ namespace boost
, typename I2::difference_type
>
# else
mpl::apply_if<
mpl::eval_if<
is_convertible<I2,I1>
, iterator_difference<I1>
, iterator_difference<I2>

View File

@ -35,7 +35,7 @@
#include <boost/type_traits/is_same.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/apply_if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
@ -140,7 +140,7 @@ namespace boost {
template<typename Tuple, class UnaryMetaFun>
struct tuple_meta_transform
: mpl::apply_if<
: mpl::eval_if<
boost::is_same<Tuple, tuples::null_type>
, mpl::identity<tuples::null_type>
, tuple_meta_transform_impl<Tuple, UnaryMetaFun>
@ -179,7 +179,7 @@ namespace boost {
, typename StartType
>
struct tuple_meta_accumulate
: mpl::apply_if<
: mpl::eval_if<
#if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
mpl::or_<
#endif
@ -337,7 +337,7 @@ namespace boost {
typedef typename iterator_traits<Iterator>::reference type;
};
#ifdef BOOST_MPL_NO_FULL_LAMBDA_SUPPORT
#ifdef BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT
// Hack because BOOST_MPL_AUX_LAMBDA_SUPPORT doesn't seem to work
// out well. Instantiating the nested apply template also
// requires instantiating iterator_traits on the
@ -400,7 +400,7 @@ namespace boost {
{
};
# ifdef BOOST_MPL_NO_FULL_LAMBDA_SUPPORT
# ifdef BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT
// Hack because BOOST_MPL_AUX_LAMBDA_SUPPORT doesn't seem to work
// out well. In this case I think it's an MPL bug
template<>

View File

@ -12,7 +12,7 @@
# include <boost/type_traits/add_const.hpp>
# include <boost/type_traits/remove_cv.hpp>
# include <boost/mpl/if.hpp>
# include <boost/mpl/apply_if.hpp>
# include <boost/mpl/eval_if.hpp>
namespace boost {
@ -55,7 +55,7 @@ namespace detail
template <class P>
struct pointee
: mpl::apply_if<
: mpl::eval_if<
detail::is_incrementable<P>
, detail::iterator_pointee<P>
, detail::smart_ptr_pointee<P>

View File

@ -25,7 +25,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/utility.hpp>
#include <boost/mpl/aux_/has_xxx.hpp>
#include <boost/mpl/has_xxx.hpp>
#include <boost/type_traits/broken_compiler_spec.hpp>
#include <vector>