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 62b04ee31f
commit 3954c2f22e
8 changed files with 20 additions and 17 deletions

View File

@ -12,10 +12,11 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/multi_index/detail/access_specifier.hpp>
#include <boost/multi_index/detail/prevent_eti.hpp>
#include <boost/mpl/apply_if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/aux_/nttp_decl.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
#include <boost/preprocessor/list/at.hpp>
@ -107,13 +108,13 @@ namespace detail{
* Similar thing for nth_composite_key_greater.
*/
template<typename CompositeKey,int N>
template<typename CompositeKey,BOOST_MPL_AUX_NTTP_DECL(int, N)>
struct nth_key_from_value
{
typedef typename CompositeKey::key_extractor_tuple key_extractor_tuple;
typedef typename prevent_eti<
tuples::element<N,key_extractor_tuple>,
typename mpl::apply_if_c<
typename mpl::eval_if_c<
N<tuples::length<key_extractor_tuple>::value,
tuples::element<N,key_extractor_tuple>,
mpl::identity<tuples::null_type>
@ -133,7 +134,7 @@ struct key_std_less<tuples::null_type>
typedef tuples::null_type type;
};
template<typename CompositeKey,int N>
template<typename CompositeKey,BOOST_MPL_AUX_NTTP_DECL(int, N)>
struct nth_composite_key_less
{
typedef typename nth_key_from_value<CompositeKey,N>::type key_from_value;
@ -152,7 +153,7 @@ struct key_std_greater<tuples::null_type>
typedef tuples::null_type type;
};
template<typename CompositeKey,int N>
template<typename CompositeKey,BOOST_MPL_AUX_NTTP_DECL(int, N)>
struct nth_composite_key_greater
{
typedef typename nth_key_from_value<CompositeKey,N>::type key_from_value;

View File

@ -12,7 +12,7 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/detail/workaround.hpp>
#include <boost/mpl/bind.hpp>
#include <boost/mpl/iter_fold_backward.hpp>
#include <boost/mpl/reverse_iter_fold.hpp>
#include <boost/multi_index_container_fwd.hpp>
#include <boost/multi_index/detail/header_holder.hpp>
#include <boost/multi_index/detail/index_base.hpp>
@ -62,7 +62,7 @@ struct multi_index_base_type
typedef typename prevent_eti<
multi_index_container<Value,IndexSpecifierList,Allocator>,
typename mpl::iter_fold_backward<
typename mpl::reverse_iter_fold<
IndexSpecifierList,
index_base<Value,IndexSpecifierList,Allocator>,
mpl::bind2<

View File

@ -12,7 +12,7 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/detail/workaround.hpp>
#include <boost/mpl/bind.hpp>
#include <boost/mpl/iter_fold_backward.hpp>
#include <boost/mpl/reverse_iter_fold.hpp>
#include <boost/multi_index_container_fwd.hpp>
#include <boost/multi_index/detail/header_holder.hpp>
#include <boost/multi_index/detail/index_node_base.hpp>
@ -59,7 +59,7 @@ struct multi_index_node_type
{
BOOST_STATIC_ASSERT(detail::is_index_list<IndexSpecifierList>::value);
typedef typename mpl::iter_fold_backward<
typedef typename mpl::reverse_iter_fold<
IndexSpecifierList,
index_node_base<Value>,
mpl::bind2<index_node_applier,mpl::_2,mpl::_1>

View File

@ -10,7 +10,7 @@
#define BOOST_MULTI_INDEX_DETAIL_ORD_INDEX_ARGS_HPP
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mpl/apply_if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/if.hpp>
#include <boost/multi_index/tag.hpp>
@ -66,7 +66,7 @@ struct ordered_index_args
full_form,
Arg3,
Arg2>::type supplied_compare_type;
typedef typename mpl::apply_if<
typedef typename mpl::eval_if<
is_same<supplied_compare_type,null_arg>,
index_args_default_compare<key_from_value_type>,
mpl::identity<supplied_compare_type>

View File

@ -42,7 +42,7 @@
#endif
#define BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM(z,n,var) \
typename BOOST_PP_CAT(var,n) BOOST_PP_EXPR_IF(n,=mpl::void_)
typename BOOST_PP_CAT(var,n) BOOST_PP_EXPR_IF(n,=mpl::na)
namespace boost{

View File

@ -61,7 +61,7 @@ template<
BOOST_PP_ENUM_BINARY_PARAMS(
BOOST_MULTI_INDEX_TAG_SIZE,
typename T,
=mpl::void_ BOOST_PP_INTERCEPT)
=mpl::na BOOST_PP_INTERCEPT)
>
struct tag:private detail::tag_marker
{

View File

@ -22,6 +22,7 @@
#include <boost/mpl/identity.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/size.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/multi_index_container_fwd.hpp>
#include <boost/multi_index/detail/access_specifier.hpp>
#include <boost/multi_index/detail/base_type.hpp>
@ -267,10 +268,10 @@ public:
>::type iter;
BOOST_STATIC_CONSTANT(
bool,index_found=!(is_same<iter,mpl::end<index_type_list> >::value));
bool,index_found=!(is_same<iter,typename mpl::end<index_type_list>::type >::value));
BOOST_STATIC_ASSERT(index_found);
typedef typename iter::type type;
typedef typename mpl::deref<iter>::type type;
};
template<typename Tag>
@ -605,10 +606,10 @@ struct index
>::type iter;
BOOST_STATIC_CONSTANT(
bool,index_found=!(is_same<iter,mpl::end<index_type_list> >::value));
bool,index_found=!(is_same<iter,typename mpl::end<index_type_list>::type >::value));
BOOST_STATIC_ASSERT(index_found);
typedef typename iter::type type;
typedef typename mpl::deref<iter>::type type;
};
template<

View File

@ -87,4 +87,5 @@ void test_basic()
std::sort(v.begin(),v.end(),less_by_employee_age());
BOOST_CHECK(std::equal(i2.begin(),i2.end(),v.begin()));
}
}