15 changes: 6 additions & 9 deletions include/boost/multi_index/detail/is_index_list.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -14,8 +14,7 @@
#endif

#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mpl/empty.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <type_traits>

namespace boost{

Expand All @@ -24,12 +23,10 @@ namespace multi_index{
namespace detail{

template<typename T>
struct is_index_list
{
BOOST_STATIC_CONSTANT(bool,mpl_sequence=mpl::is_sequence<T>::value);
BOOST_STATIC_CONSTANT(bool,non_empty=!mpl::empty<T>::value);
BOOST_STATIC_CONSTANT(bool,value=mpl_sequence&&non_empty);
};
struct is_index_list:std::false_type{};

template<template <class...> class L,typename typename T0,typename... T>
struct is_index_list<L<T0,T...>>:std::true_type{};

} /* namespace multi_index::detail */

Expand Down
28 changes: 13 additions & 15 deletions include/boost/multi_index/detail/is_transparent.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2014 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -14,8 +14,8 @@
#endif

#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/intrinsics.hpp>
#include <type_traits>

namespace boost{

Expand All @@ -29,7 +29,7 @@ namespace detail{
*/

template<typename F,typename Arg1,typename Arg2,typename=void>
struct is_transparent:mpl::true_{};
struct is_transparent:std::true_type{};

} /* namespace multi_index::detail */

Expand All @@ -41,9 +41,7 @@ struct is_transparent:mpl::true_{};
!defined(BOOST_NO_CXX11_DECLTYPE)&& \
(defined(BOOST_NO_CXX11_FINAL)||defined(BOOST_IS_FINAL))

#include <boost/mpl/and.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mp11/function.hpp>
#include <boost/type_traits/function_traits.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/is_final.hpp>
Expand All @@ -70,7 +68,7 @@ struct is_transparent_class_helper:F
};

template<typename F,typename Arg1,typename Arg2,typename=void>
struct is_transparent_class:mpl::true_{};
struct is_transparent_class:std::true_type{};

template<typename F,typename Arg1,typename Arg2>
struct is_transparent_class<
Expand All @@ -84,38 +82,38 @@ struct is_transparent_class<
not_is_transparent_result_type
>
>::type
>:mpl::false_{};
>:std::false_type{};

template<typename F,typename Arg1,typename Arg2>
struct is_transparent<
F,Arg1,Arg2,
typename enable_if<
mpl::and_<
mp11::mp_and<
is_class<F>,
mpl::not_<is_final<F> > /* is_transparent_class_helper derives from F */
mp11::mp_not<is_final<F> > /* is_transparent_class_helper derives from F */
>
>::type
>:is_transparent_class<F,Arg1,Arg2>{};

template<typename F,typename Arg1,typename Arg2,typename=void>
struct is_transparent_function:mpl::true_{};
struct is_transparent_function:std::true_type{};

template<typename F,typename Arg1,typename Arg2>
struct is_transparent_function<
F,Arg1,Arg2,
typename enable_if<
mpl::or_<
mpl::not_<mpl::or_<
mp11::mp_or<
mp11::mp_not<mp11::mp_or<
is_same<typename function_traits<F>::arg1_type,const Arg1&>,
is_same<typename function_traits<F>::arg1_type,Arg1>
> >,
mpl::not_<mpl::or_<
mp11::mp_not<mp11::mp_or<
is_same<typename function_traits<F>::arg2_type,const Arg2&>,
is_same<typename function_traits<F>::arg2_type,Arg2>
> >
>
>::type
>:mpl::false_{};
>:std::false_type{};

template<typename F,typename Arg1,typename Arg2>
struct is_transparent<
Expand Down
32 changes: 10 additions & 22 deletions include/boost/multi_index/detail/iter_adaptor.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -14,7 +14,7 @@
#endif

#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mpl/apply.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/operators.hpp>

namespace boost{
Expand Down Expand Up @@ -125,10 +125,7 @@ template<>
struct iter_adaptor_selector<std::forward_iterator_tag>
{
template<class Derived,class Base>
struct apply
{
typedef forward_iter_adaptor_base<Derived,Base> type;
};
using fn=forward_iter_adaptor_base<Derived,Base>;
};

template<class Derived,class Base>
Expand Down Expand Up @@ -183,10 +180,7 @@ template<>
struct iter_adaptor_selector<std::bidirectional_iterator_tag>
{
template<class Derived,class Base>
struct apply
{
typedef bidirectional_iter_adaptor_base<Derived,Base> type;
};
using fn=bidirectional_iter_adaptor_base<Derived,Base>;
};

template<class Derived,class Base>
Expand Down Expand Up @@ -283,23 +277,17 @@ template<>
struct iter_adaptor_selector<std::random_access_iterator_tag>
{
template<class Derived,class Base>
struct apply
{
typedef random_access_iter_adaptor_base<Derived,Base> type;
};
using fn=random_access_iter_adaptor_base<Derived,Base>;
};

template<class Derived,class Base>
struct iter_adaptor_base
{
typedef iter_adaptor_selector<
typename Base::iterator_category> selector;
typedef typename mpl::apply2<
selector,Derived,Base>::type type;
};
using iter_adaptor_base= mp11::mp_invoke<
iter_adaptor_selector<typename Base::iterator_category>,
Derived,Base
>;

template<class Derived,class Base>
class iter_adaptor:public iter_adaptor_base<Derived,Base>::type
class iter_adaptor:public iter_adaptor_base<Derived,Base>
{
protected:
iter_adaptor(){}
Expand Down
66 changes: 17 additions & 49 deletions include/boost/multi_index/detail/no_duplicate_tags.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -14,8 +14,9 @@
#endif

#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mpl/fold.hpp>
#include <boost/mpl/set/set0.hpp>
#include <boost/mp11/algorithm.hpp>
#include <boost/mp11/list.hpp>
#include <boost/mp11/set.hpp>

namespace boost{

Expand All @@ -25,68 +26,35 @@ namespace detail{

/* no_duplicate_tags check at compile-time that a tag list
* has no duplicate tags.
* The algorithm deserves some explanation: tags
* are sequentially inserted into a mpl::set if they were
* not already present. Due to the magic of mpl::set
* (mpl::has_key is contant time), this operation takes linear
* time, and even MSVC++ 6.5 handles it gracefully (other obvious
* solutions are quadratic.)
*/

struct duplicate_tag_mark{};

struct duplicate_tag_marker
{
template <typename MplSet,typename Tag>
struct apply
{
typedef mpl::s_item<
typename mpl::if_<mpl::has_key<MplSet,Tag>,duplicate_tag_mark,Tag>::type,
MplSet
> type;
};
};

template<typename TagList>
struct no_duplicate_tags
{
typedef typename mpl::fold<
typedef mp11::mp_fold<
TagList,
mpl::set0<>,
duplicate_tag_marker
>::type aux;
mp11::mp_list<>,
mp11::mp_set_push_back
> aux;

BOOST_STATIC_CONSTANT(
bool,value=!(mpl::has_key<aux,duplicate_tag_mark>::value));
bool,value=(mp11::mp_size<TagList>::value==mp11::mp_size<aux>::value));
};

/* Variant for an index list: duplication is checked
* across all the indices.
*/

struct duplicate_tag_list_marker
{
template <typename MplSet,typename Index>
struct apply:mpl::fold<
BOOST_DEDUCED_TYPENAME Index::tag_list,
MplSet,
duplicate_tag_marker>
{
};
};
template<typename Index>
using index_tag_list=typename Index::tag_list;

template<typename IndexList>
struct no_duplicate_tags_in_index_list
{
typedef typename mpl::fold<
IndexList,
mpl::set0<>,
duplicate_tag_list_marker
>::type aux;

BOOST_STATIC_CONSTANT(
bool,value=!(mpl::has_key<aux,duplicate_tag_mark>::value));
};
using no_duplicate_tags_in_index_list=no_duplicate_tags<
mp11::mp_apply<
mp11::mp_append,
mp11::mp_transform<index_tag_list,IndexList>
>
>;

} /* namespace multi_index::detail */

Expand Down
24 changes: 7 additions & 17 deletions include/boost/multi_index/detail/node_type.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -15,9 +15,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/reverse_iter_fold.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mp11/algorithm.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>
Expand All @@ -34,27 +32,19 @@ namespace detail{
* index list.
*/

struct index_node_applier
{
template<typename IndexSpecifierIterator,typename Super>
struct apply
{
typedef typename mpl::deref<IndexSpecifierIterator>::type index_specifier;
typedef typename index_specifier::
BOOST_NESTED_TEMPLATE node_class<Super>::type type;
};
};
template<typename IndexSpecifier,typename Super>
using node_type=typename IndexSpecifier::template node_class<Super>::type;

template<typename Value,typename IndexSpecifierList,typename Allocator>
struct multi_index_node_type
{
BOOST_STATIC_ASSERT(detail::is_index_list<IndexSpecifierList>::value);

typedef typename mpl::reverse_iter_fold<
typedef mp11::mp_reverse_fold<
IndexSpecifierList,
index_node_base<Value,Allocator>,
mpl::bind2<index_node_applier,mpl::_2,mpl::_1>
>::type type;
node_type
> type;
};

} /* namespace multi_index::detail */
Expand Down
41 changes: 17 additions & 24 deletions include/boost/multi_index/detail/ord_index_args.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -14,14 +14,12 @@
#endif

#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mpl/aux_/na.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/multi_index/tag.hpp>
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_same.hpp>
#include <functional>
#include <type_traits>

namespace boost{

Expand All @@ -40,38 +38,33 @@ namespace detail{
* polymorphism.
*/

template<typename KeyFromValue>
struct index_args_default_compare
{
typedef std::less<typename KeyFromValue::result_type> type;
};

template<typename Arg1,typename Arg2,typename Arg3>
struct ordered_index_args
{
typedef is_tag<Arg1> full_form;

typedef typename mpl::if_<
typedef mp11::mp_if<
full_form,
Arg1,
tag< > >::type tag_list_type;
typedef typename mpl::if_<
tag< > > tag_list_type;
typedef mp11::mp_if<
full_form,
Arg2,
Arg1>::type key_from_value_type;
typedef typename mpl::if_<
Arg1> key_from_value_type;
typedef mp11::mp_if<
full_form,
Arg3,
Arg2>::type supplied_compare_type;
typedef typename mpl::eval_if<
mpl::is_na<supplied_compare_type>,
index_args_default_compare<key_from_value_type>,
mpl::identity<supplied_compare_type>
>::type compare_type;
Arg2> supplied_compare_type;
typedef mp11::mp_eval_if_c<
!std::is_void<supplied_compare_type>::value,
supplied_compare_type,
std::less,
typename key_from_value_type::result_type
> compare_type;

BOOST_STATIC_ASSERT(is_tag<tag_list_type>::value);
BOOST_STATIC_ASSERT(!mpl::is_na<key_from_value_type>::value);
BOOST_STATIC_ASSERT(!mpl::is_na<compare_type>::value);
BOOST_STATIC_ASSERT(!std::is_void<key_from_value_type>::value);
BOOST_STATIC_ASSERT(!std::is_void<compare_type>::value);
};

} /* namespace multi_index::detail */
Expand Down
30 changes: 15 additions & 15 deletions include/boost/multi_index/detail/ord_index_impl.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand Down Expand Up @@ -48,9 +48,9 @@
#include <boost/foreach_fwd.hpp>
#include <boost/iterator/reverse_iterator.hpp>
#include <boost/move/core.hpp>
#include <boost/mp11/list.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/push_front.hpp>
#include <boost/multi_index/detail/access_specifier.hpp>
#include <boost/multi_index/detail/bidir_node_iterator.hpp>
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
Expand Down Expand Up @@ -189,18 +189,18 @@ class ordered_index_impl:
typedef tuples::cons<
ctor_args,
typename super::ctor_args_list> ctor_args_list;
typedef typename mpl::push_front<
typedef mp11::mp_push_front<
typename super::index_type_list,
ordered_index<
KeyFromValue,Compare,
SuperMeta,TagList,Category,AugmentPolicy
> >::type index_type_list;
typedef typename mpl::push_front<
> > index_type_list;
typedef mp11::mp_push_front<
typename super::iterator_type_list,
iterator>::type iterator_type_list;
typedef typename mpl::push_front<
iterator> iterator_type_list;
typedef mp11::mp_push_front<
typename super::const_iterator_type_list,
const_iterator>::type const_iterator_type_list;
const_iterator> const_iterator_type_list;
typedef typename super::copy_map_type copy_map_type;

#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
Expand Down Expand Up @@ -574,19 +574,19 @@ class ordered_index_impl:
std::pair<iterator,iterator>
range(LowerBounder lower,UpperBounder upper)const
{
typedef typename mpl::if_<
typedef mp11::mp_if<
is_same<LowerBounder,unbounded_type>,
BOOST_DEDUCED_TYPENAME mpl::if_<
mp11::mp_if<
is_same<UpperBounder,unbounded_type>,
both_unbounded_tag,
lower_unbounded_tag
>::type,
BOOST_DEDUCED_TYPENAME mpl::if_<
>,
mp11::mp_if<
is_same<UpperBounder,unbounded_type>,
upper_unbounded_tag,
none_unbounded_tag
>::type
>::type dispatch;
>
> dispatch;

return range(lower,upper,dispatch());
}
Expand Down
10 changes: 5 additions & 5 deletions include/boost/multi_index/detail/ord_index_node.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand Down Expand Up @@ -46,8 +46,8 @@
#include <boost/multi_index/detail/raw_ptr.hpp>

#if !defined(BOOST_MULTI_INDEX_DISABLE_COMPRESSED_ORDERED_INDEX_NODES)
#include <boost/mpl/and.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mp11/function.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/multi_index/detail/uintptr_type.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <boost/type_traits/is_same.hpp>
Expand Down Expand Up @@ -211,7 +211,7 @@ struct ordered_index_node_impl_base:

#if !defined(BOOST_MULTI_INDEX_DISABLE_COMPRESSED_ORDERED_INDEX_NODES)
AugmentPolicy::template augmented_node<
typename mpl::if_c<
mp11::mp_if_c<
!(has_uintptr_type::value)||
(alignment_of<
ordered_index_node_compressed_base<AugmentPolicy,Allocator>
Expand All @@ -224,7 +224,7 @@ struct ordered_index_node_impl_base:
ordered_index_node_impl<AugmentPolicy,Allocator>*>::value),
ordered_index_node_std_base<AugmentPolicy,Allocator>,
ordered_index_node_compressed_base<AugmentPolicy,Allocator>
>::type
>
>::type
#else
AugmentPolicy::template augmented_node<
Expand Down
37 changes: 19 additions & 18 deletions include/boost/multi_index/detail/ord_index_ops.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2014 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand Down Expand Up @@ -41,8 +41,9 @@
#endif

#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mpl/and.hpp>
#include <boost/mp11/function.hpp>
#include <boost/multi_index/detail/promotes_arg.hpp>
#include <type_traits>
#include <utility>

namespace boost{
Expand Down Expand Up @@ -70,7 +71,7 @@ inline Node* ordered_index_find(

return ordered_index_find(
top,y,key,x,comp,
mpl::and_<
mp11::mp_and<
promotes_1st_arg<CompatibleCompare,CompatibleKey,key_type>,
promotes_2nd_arg<CompatibleCompare,key_type,CompatibleKey> >());
}
Expand All @@ -82,9 +83,9 @@ template<
inline Node* ordered_index_find(
Node* top,Node* y,const KeyFromValue& key,
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
const CompatibleCompare& comp,std::true_type)
{
return ordered_index_find(top,y,key,x,comp,mpl::false_());
return ordered_index_find(top,y,key,x,comp,std::false_type());
}

template<
Expand All @@ -93,7 +94,7 @@ template<
>
inline Node* ordered_index_find(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,mpl::false_)
const CompatibleCompare& comp,std::false_type)
{
Node* y0=y;

Expand Down Expand Up @@ -130,9 +131,9 @@ template<
inline Node* ordered_index_lower_bound(
Node* top,Node* y,const KeyFromValue& key,
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
const CompatibleCompare& comp,std::true_type)
{
return ordered_index_lower_bound(top,y,key,x,comp,mpl::false_());
return ordered_index_lower_bound(top,y,key,x,comp,std::false_type());
}

template<
Expand All @@ -141,7 +142,7 @@ template<
>
inline Node* ordered_index_lower_bound(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,mpl::false_)
const CompatibleCompare& comp,std::false_type)
{
while(top){
if(!comp(key(top->value()),x)){
Expand Down Expand Up @@ -176,9 +177,9 @@ template<
inline Node* ordered_index_upper_bound(
Node* top,Node* y,const KeyFromValue& key,
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
const CompatibleCompare& comp,std::true_type)
{
return ordered_index_upper_bound(top,y,key,x,comp,mpl::false_());
return ordered_index_upper_bound(top,y,key,x,comp,std::false_type());
}

template<
Expand All @@ -187,7 +188,7 @@ template<
>
inline Node* ordered_index_upper_bound(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,mpl::false_)
const CompatibleCompare& comp,std::false_type)
{
while(top){
if(comp(x,key(top->value()))){
Expand All @@ -212,7 +213,7 @@ inline std::pair<Node*,Node*> ordered_index_equal_range(

return ordered_index_equal_range(
top,y,key,x,comp,
mpl::and_<
mp11::mp_and<
promotes_1st_arg<CompatibleCompare,CompatibleKey,key_type>,
promotes_2nd_arg<CompatibleCompare,key_type,CompatibleKey> >());
}
Expand All @@ -224,9 +225,9 @@ template<
inline std::pair<Node*,Node*> ordered_index_equal_range(
Node* top,Node* y,const KeyFromValue& key,
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
const CompatibleCompare& comp,std::true_type)
{
return ordered_index_equal_range(top,y,key,x,comp,mpl::false_());
return ordered_index_equal_range(top,y,key,x,comp,std::false_type());
}

template<
Expand All @@ -235,7 +236,7 @@ template<
>
inline std::pair<Node*,Node*> ordered_index_equal_range(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,mpl::false_)
const CompatibleCompare& comp,std::false_type)
{
while(top){
if(comp(key(top->value()),x)){
Expand All @@ -248,9 +249,9 @@ inline std::pair<Node*,Node*> ordered_index_equal_range(
else{
return std::pair<Node*,Node*>(
ordered_index_lower_bound(
Node::from_impl(top->left()),top,key,x,comp,mpl::false_()),
Node::from_impl(top->left()),top,key,x,comp,std::false_type()),
ordered_index_upper_bound(
Node::from_impl(top->right()),y,key,x,comp,mpl::false_()));
Node::from_impl(top->right()),y,key,x,comp,std::false_type()));
}
}

Expand Down
16 changes: 7 additions & 9 deletions include/boost/multi_index/detail/promotes_arg.hpp
Expand Up @@ -30,10 +30,10 @@ namespace multi_index{
namespace detail{

template<typename F,typename Arg1,typename Arg2>
struct promotes_1st_arg:mpl::false_{};
struct promotes_1st_arg:std::false_type{};

template<typename F,typename Arg1,typename Arg2>
struct promotes_2nd_arg:mpl::false_{};
struct promotes_2nd_arg:std::false_type{};

} /* namespace multi_index::detail */

Expand All @@ -43,9 +43,7 @@ struct promotes_2nd_arg:mpl::false_{};

#else

#include <boost/mpl/and.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mp11/function.hpp>
#include <boost/multi_index/detail/is_transparent.hpp>
#include <boost/type_traits/is_convertible.hpp>

Expand All @@ -57,17 +55,17 @@ namespace detail{

template<typename F,typename Arg1,typename Arg2>
struct promotes_1st_arg:
mpl::and_<
mpl::not_<is_transparent<F,Arg1,Arg2> >,
mp11::mp_and<
mp11::mp_not<is_transparent<F,Arg1,Arg2> >,
is_convertible<const Arg1,Arg2>,
is_transparent<F,Arg2,Arg2>
>
{};

template<typename F,typename Arg1,typename Arg2>
struct promotes_2nd_arg:
mpl::and_<
mpl::not_<is_transparent<F,Arg1,Arg2> >,
mp11::mp_and<
mp11::mp_not<is_transparent<F,Arg1,Arg2> >,
is_convertible<const Arg2,Arg1>,
is_transparent<F,Arg1,Arg1>
>
Expand Down
11 changes: 5 additions & 6 deletions include/boost/multi_index/detail/raw_ptr.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -14,8 +14,7 @@
#endif

#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/is_same.hpp>
#include <type_traits>

namespace boost{

Expand All @@ -26,21 +25,21 @@ namespace detail{
/* gets the underlying pointer of a pointer-like value */

template<typename RawPointer>
inline RawPointer raw_ptr(RawPointer const& p,mpl::true_)
inline RawPointer raw_ptr(RawPointer const& p,std::true_type)
{
return p;
}

template<typename RawPointer,typename Pointer>
inline RawPointer raw_ptr(Pointer const& p,mpl::false_)
inline RawPointer raw_ptr(Pointer const& p,std::false_type)
{
return p==Pointer(0)?0:&*p;
}

template<typename RawPointer,typename Pointer>
inline RawPointer raw_ptr(Pointer const& p)
{
return raw_ptr<RawPointer>(p,is_same<RawPointer,Pointer>());
return raw_ptr<RawPointer>(p,std::is_same<RawPointer,Pointer>());
}

} /* namespace multi_index::detail */
Expand Down
35 changes: 18 additions & 17 deletions include/boost/multi_index/detail/rnk_index_ops.hpp
Expand Up @@ -14,9 +14,10 @@
#endif

#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mpl/and.hpp>
#include <boost/mp11/function.hpp>
#include <boost/multi_index/detail/promotes_arg.hpp>
#include <cstddef>
#include <type_traits>
#include <utility>

namespace boost{
Expand Down Expand Up @@ -82,7 +83,7 @@ inline std::size_t ranked_index_find_rank(

return ranked_index_find_rank(
top,y,key,x,comp,
mpl::and_<
mp11::mp_and<
promotes_1st_arg<CompatibleCompare,CompatibleKey,key_type>,
promotes_2nd_arg<CompatibleCompare,key_type,CompatibleKey> >());
}
Expand All @@ -94,9 +95,9 @@ template<
inline std::size_t ranked_index_find_rank(
Node* top,Node* y,const KeyFromValue& key,
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
const CompatibleCompare& comp,std::true_type)
{
return ranked_index_find_rank(top,y,key,x,comp,mpl::false_());
return ranked_index_find_rank(top,y,key,x,comp,std::false_type());
}

template<
Expand All @@ -105,7 +106,7 @@ template<
>
inline std::size_t ranked_index_find_rank(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,mpl::false_)
const CompatibleCompare& comp,std::false_type)
{
if(!top)return 0;

Expand Down Expand Up @@ -147,9 +148,9 @@ template<
inline std::size_t ranked_index_lower_bound_rank(
Node* top,Node* y,const KeyFromValue& key,
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
const CompatibleCompare& comp,std::true_type)
{
return ranked_index_lower_bound_rank(top,y,key,x,comp,mpl::false_());
return ranked_index_lower_bound_rank(top,y,key,x,comp,std::false_type());
}

template<
Expand All @@ -158,7 +159,7 @@ template<
>
inline std::size_t ranked_index_lower_bound_rank(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,mpl::false_)
const CompatibleCompare& comp,std::false_type)
{
if(!top)return 0;

Expand Down Expand Up @@ -198,9 +199,9 @@ template<
inline std::size_t ranked_index_upper_bound_rank(
Node* top,Node* y,const KeyFromValue& key,
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
const CompatibleCompare& comp,std::true_type)
{
return ranked_index_upper_bound_rank(top,y,key,x,comp,mpl::false_());
return ranked_index_upper_bound_rank(top,y,key,x,comp,std::false_type());
}

template<
Expand All @@ -209,7 +210,7 @@ template<
>
inline std::size_t ranked_index_upper_bound_rank(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,mpl::false_)
const CompatibleCompare& comp,std::false_type)
{
if(!top)return 0;

Expand Down Expand Up @@ -239,7 +240,7 @@ inline std::pair<std::size_t,std::size_t> ranked_index_equal_range_rank(

return ranked_index_equal_range_rank(
top,y,key,x,comp,
mpl::and_<
mp11::mp_and<
promotes_1st_arg<CompatibleCompare,CompatibleKey,key_type>,
promotes_2nd_arg<CompatibleCompare,key_type,CompatibleKey> >());
}
Expand All @@ -251,9 +252,9 @@ template<
inline std::pair<std::size_t,std::size_t> ranked_index_equal_range_rank(
Node* top,Node* y,const KeyFromValue& key,
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
const CompatibleCompare& comp,std::true_type)
{
return ranked_index_equal_range_rank(top,y,key,x,comp,mpl::false_());
return ranked_index_equal_range_rank(top,y,key,x,comp,std::false_type());
}

template<
Expand All @@ -262,7 +263,7 @@ template<
>
inline std::pair<std::size_t,std::size_t> ranked_index_equal_range_rank(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,mpl::false_)
const CompatibleCompare& comp,std::false_type)
{
if(!top)return std::pair<std::size_t,std::size_t>(0,0);

Expand All @@ -281,10 +282,10 @@ inline std::pair<std::size_t,std::size_t> ranked_index_equal_range_rank(
return std::pair<std::size_t,std::size_t>(
s-top->impl()->size+
ranked_index_lower_bound_rank(
Node::from_impl(top->left()),top,key,x,comp,mpl::false_()),
Node::from_impl(top->left()),top,key,x,comp,std::false_type()),
s-ranked_node_size(top->right())+
ranked_index_upper_bound_rank(
Node::from_impl(top->right()),y,key,x,comp,mpl::false_()));
Node::from_impl(top->right()),y,key,x,comp,std::false_type()));
}
}while(top);

Expand Down
6 changes: 3 additions & 3 deletions include/boost/multi_index/detail/scope_guard.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -14,7 +14,7 @@
#endif

#include <boost/detail/no_exceptions_support.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mp11/utility.hpp>

namespace boost{

Expand Down Expand Up @@ -120,7 +120,7 @@ struct null_guard : public scope_guard_impl_base
template< bool cond, class T >
struct null_guard_return
{
typedef typename boost::mpl::if_c<cond,T,null_guard>::type type;
typedef typename boost::mp11::mp_if_c<cond,T,null_guard>::type type;
};

template<typename F>
Expand Down
8 changes: 4 additions & 4 deletions include/boost/multi_index/detail/uintptr_type.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -14,7 +14,7 @@
#endif

#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mpl/bool.hpp>
#include <boost/mp11/integral.hpp>

namespace boost{

Expand Down Expand Up @@ -64,8 +64,8 @@ struct uintptr_aux
typedef uintptr_candidates<index>::type type;
};

typedef mpl::bool_<uintptr_aux::has_uintptr_type> has_uintptr_type;
typedef uintptr_aux::type uintptr_type;
typedef mp11::mp_bool<uintptr_aux::has_uintptr_type> has_uintptr_type;
typedef uintptr_aux::type uintptr_type;

} /* namespace multi_index::detail */

Expand Down
12 changes: 6 additions & 6 deletions include/boost/multi_index/global_fun.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -15,7 +15,7 @@

#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/detail/workaround.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_reference.hpp>
#include <boost/type_traits/remove_const.hpp>
Expand Down Expand Up @@ -166,15 +166,15 @@ struct non_ref_global_fun_base

template<class Value,typename Type,Type (*PtrToFunction)(Value)>
struct global_fun:
mpl::if_c<
mp11::mp_if_c<
is_reference<Value>::value,
typename mpl::if_c<
mp11::mp_if_c<
is_const<typename remove_reference<Value>::type>::value,
detail::const_ref_global_fun_base<Value,Type,PtrToFunction>,
detail::non_const_ref_global_fun_base<Value,Type,PtrToFunction>
>::type,
>,
detail::non_ref_global_fun_base<Value,Type,PtrToFunction>
>::type
>
{
};

Expand Down
45 changes: 23 additions & 22 deletions include/boost/multi_index/hashed_index.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -22,9 +22,9 @@
#include <boost/foreach_fwd.hpp>
#include <boost/limits.hpp>
#include <boost/move/core.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/mp11/list.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/push_front.hpp>
#include <boost/multi_index/detail/access_specifier.hpp>
#include <boost/multi_index/detail/auto_space.hpp>
#include <boost/multi_index/detail/bucket_array.hpp>
Expand All @@ -43,6 +43,7 @@
#include <cstddef>
#include <functional>
#include <iterator>
#include <type_traits>
#include <utility>

#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
Expand Down Expand Up @@ -159,15 +160,15 @@ class hashed_index:
typedef tuples::cons<
ctor_args,
typename super::ctor_args_list> ctor_args_list;
typedef typename mpl::push_front<
typedef mp11::mp_push_front<
typename super::index_type_list,
hashed_index>::type index_type_list;
typedef typename mpl::push_front<
hashed_index> index_type_list;
typedef mp11::mp_push_front<
typename super::iterator_type_list,
iterator>::type iterator_type_list;
typedef typename mpl::push_front<
iterator> iterator_type_list;
typedef mp11::mp_push_front<
typename super::const_iterator_type_list,
const_iterator>::type const_iterator_type_list;
const_iterator> const_iterator_type_list;
typedef typename super::copy_map_type copy_map_type;

#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
Expand Down Expand Up @@ -1136,11 +1137,11 @@ class hashed_index:
node_impl_base_pointer first,last;
};

typedef typename mpl::if_<
typedef mp11::mp_if<
is_same<Category,hashed_unique_tag>,
node_impl_base_pointer,
link_info_non_unique
>::type link_info;
> link_info;

bool link_point(value_param_type v,link_info& pos)
{
Expand Down Expand Up @@ -1512,17 +1513,17 @@ class hashed_index:
>
iterator find(
const key_type& k,
const CompatibleHash& hash,const CompatiblePred& eq,mpl::true_)const
const CompatibleHash& hash,const CompatiblePred& eq,std::true_type)const
{
return find(k,hash,eq,mpl::false_());
return find(k,hash,eq,std::false_type());
}

template<
typename CompatibleKey,typename CompatibleHash,typename CompatiblePred
>
iterator find(
const CompatibleKey& k,
const CompatibleHash& hash,const CompatiblePred& eq,mpl::false_)const
const CompatibleHash& hash,const CompatiblePred& eq,std::false_type)const
{
std::size_t buc=buckets.position(hash(k));
for(node_impl_pointer x=buckets.at(buc)->prior();
Expand All @@ -1539,17 +1540,17 @@ class hashed_index:
>
size_type count(
const key_type& k,
const CompatibleHash& hash,const CompatiblePred& eq,mpl::true_)const
const CompatibleHash& hash,const CompatiblePred& eq,std::true_type)const
{
return count(k,hash,eq,mpl::false_());
return count(k,hash,eq,std::false_type());
}

template<
typename CompatibleKey,typename CompatibleHash,typename CompatiblePred
>
size_type count(
const CompatibleKey& k,
const CompatibleHash& hash,const CompatiblePred& eq,mpl::false_)const
const CompatibleHash& hash,const CompatiblePred& eq,std::false_type)const
{
std::size_t buc=buckets.position(hash(k));
for(node_impl_pointer x=buckets.at(buc)->prior();
Expand All @@ -1572,17 +1573,17 @@ class hashed_index:
>
std::pair<iterator,iterator> equal_range(
const key_type& k,
const CompatibleHash& hash,const CompatiblePred& eq,mpl::true_)const
const CompatibleHash& hash,const CompatiblePred& eq,std::true_type)const
{
return equal_range(k,hash,eq,mpl::false_());
return equal_range(k,hash,eq,std::false_type());
}

template<
typename CompatibleKey,typename CompatibleHash,typename CompatiblePred
>
std::pair<iterator,iterator> equal_range(
const CompatibleKey& k,
const CompatibleHash& hash,const CompatiblePred& eq,mpl::false_)const
const CompatibleHash& hash,const CompatiblePred& eq,std::false_type)const
{
std::size_t buc=buckets.position(hash(k));
for(node_impl_pointer x=buckets.at(buc)->prior();
Expand Down Expand Up @@ -1655,7 +1656,7 @@ struct hashed_unique
{
typedef typename detail::hashed_index_args<
Arg1,Arg2,Arg3,Arg4> index_args;
typedef typename index_args::tag_list_type::type tag_list_type;
typedef typename index_args::tag_list_type tag_list_type;
typedef typename index_args::key_from_value_type key_from_value_type;
typedef typename index_args::hash_type hash_type;
typedef typename index_args::pred_type pred_type;
Expand All @@ -1680,7 +1681,7 @@ struct hashed_non_unique
{
typedef typename detail::hashed_index_args<
Arg1,Arg2,Arg3,Arg4> index_args;
typedef typename index_args::tag_list_type::type tag_list_type;
typedef typename index_args::tag_list_type tag_list_type;
typedef typename index_args::key_from_value_type key_from_value_type;
typedef typename index_args::hash_type hash_type;
typedef typename index_args::pred_type pred_type;
Expand Down
10 changes: 5 additions & 5 deletions include/boost/multi_index/hashed_index_fwd.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand Down Expand Up @@ -56,14 +56,14 @@ void swap(
/* hashed_index specifiers */

template<
typename Arg1,typename Arg2=mpl::na,
typename Arg3=mpl::na,typename Arg4=mpl::na
typename Arg1,typename Arg2=void,
typename Arg3=void,typename Arg4=void
>
struct hashed_unique;

template<
typename Arg1,typename Arg2=mpl::na,
typename Arg3=mpl::na,typename Arg4=mpl::na
typename Arg1,typename Arg2=void,
typename Arg3=void,typename Arg4=void
>
struct hashed_non_unique;

Expand Down
8 changes: 4 additions & 4 deletions include/boost/multi_index/identity.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -15,7 +15,7 @@

#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/multi_index/identity_fwd.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/remove_const.hpp>
Expand Down Expand Up @@ -131,10 +131,10 @@ struct non_const_identity_base

template<class Type>
struct identity:
mpl::if_c<
mp11::mp_if_c<
is_const<Type>::value,
detail::const_identity_base<Type>,detail::non_const_identity_base<Type>
>::type
>
{
};

Expand Down
40 changes: 5 additions & 35 deletions include/boost/multi_index/indexed_by.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -14,49 +14,19 @@
#endif

#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mpl/vector.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/mp11/list.hpp>

/* An alias to mpl::vector used to hide MPL from the user.
/* An alias to mp11::mp_list used to hide Mp11 from the user.
* indexed_by contains the index specifiers for instantiation
* of a multi_index_container.
*/

/* This user_definable macro limits the number of elements of an index list;
* useful for shortening resulting symbol names (MSVC++ 6.0, for instance,
* has problems coping with very long symbol names.)
*/

#if !defined(BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE)
#define BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE
#endif

#if BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE<BOOST_MPL_LIMIT_VECTOR_SIZE
#define BOOST_MULTI_INDEX_INDEXED_BY_SIZE \
BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE
#else
#define BOOST_MULTI_INDEX_INDEXED_BY_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE
#endif

#define BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM(z,n,var) \
typename BOOST_PP_CAT(var,n) BOOST_PP_EXPR_IF(n,=mpl::na)

namespace boost{

namespace multi_index{

template<
BOOST_PP_ENUM(
BOOST_MULTI_INDEX_INDEXED_BY_SIZE,
BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM,T)
>
struct indexed_by:
mpl::vector<BOOST_PP_ENUM_PARAMS(BOOST_MULTI_INDEX_INDEXED_BY_SIZE,T)>
{
};
template<typename... T>
using indexed_by=mp11::mp_list<T...>;

} /* namespace multi_index */

Expand Down
3 changes: 1 addition & 2 deletions include/boost/multi_index/mem_fun.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -14,7 +14,6 @@
#endif

#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mpl/if.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/utility/enable_if.hpp>

Expand Down
12 changes: 6 additions & 6 deletions include/boost/multi_index/member.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -14,7 +14,7 @@
#endif

#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mpl/if.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/utility/enable_if.hpp>
#include <cstddef>
Expand Down Expand Up @@ -120,11 +120,11 @@ struct non_const_member_base

template<class Class,typename Type,Type Class::*PtrToMember>
struct member:
mpl::if_c<
mp11::mp_if_c<
is_const<Type>::value,
detail::const_member_base<Class,Type,PtrToMember>,
detail::non_const_member_base<Class,Type,PtrToMember>
>::type
>
{
};

Expand Down Expand Up @@ -234,11 +234,11 @@ struct non_const_member_offset_base

template<class Class,typename Type,std::size_t OffsetOfMember>
struct member_offset:
mpl::if_c<
mp11::mp_if_c<
is_const<Type>::value,
detail::const_member_offset_base<Class,Type,OffsetOfMember>,
detail::non_const_member_offset_base<Class,Type,OffsetOfMember>
>::type
>
{
};

Expand Down
6 changes: 3 additions & 3 deletions include/boost/multi_index/ordered_index.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand Down Expand Up @@ -62,7 +62,7 @@ struct ordered_unique
{
typedef typename detail::ordered_index_args<
Arg1,Arg2,Arg3> index_args;
typedef typename index_args::tag_list_type::type tag_list_type;
typedef typename index_args::tag_list_type tag_list_type;
typedef typename index_args::key_from_value_type key_from_value_type;
typedef typename index_args::compare_type compare_type;

Expand All @@ -87,7 +87,7 @@ struct ordered_non_unique
{
typedef detail::ordered_index_args<
Arg1,Arg2,Arg3> index_args;
typedef typename index_args::tag_list_type::type tag_list_type;
typedef typename index_args::tag_list_type tag_list_type;
typedef typename index_args::key_from_value_type key_from_value_type;
typedef typename index_args::compare_type compare_type;

Expand Down
6 changes: 3 additions & 3 deletions include/boost/multi_index/ordered_index_fwd.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -22,10 +22,10 @@ namespace multi_index{

/* ordered_index specifiers */

template<typename Arg1,typename Arg2=mpl::na,typename Arg3=mpl::na>
template<typename Arg1,typename Arg2=void,typename Arg3=void>
struct ordered_unique;

template<typename Arg1,typename Arg2=mpl::na,typename Arg3=mpl::na>
template<typename Arg1,typename Arg2=void,typename Arg3=void>
struct ordered_non_unique;

} /* namespace multi_index */
Expand Down
34 changes: 17 additions & 17 deletions include/boost/multi_index/random_access_index.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -23,9 +23,9 @@
#include <boost/iterator/reverse_iterator.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility.hpp>
#include <boost/mp11/list.hpp>
#include <boost/mp11/function.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/push_front.hpp>
#include <boost/multi_index/detail/access_specifier.hpp>
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
#include <boost/multi_index/detail/index_node_base.hpp>
Expand All @@ -43,6 +43,7 @@
#include <cstddef>
#include <functional>
#include <stdexcept>
#include <type_traits>
#include <utility>

#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
Expand Down Expand Up @@ -141,15 +142,15 @@ class random_access_index:
typedef tuples::cons<
ctor_args,
typename super::ctor_args_list> ctor_args_list;
typedef typename mpl::push_front<
typedef mp11::mp_push_front<
typename super::index_type_list,
random_access_index>::type index_type_list;
typedef typename mpl::push_front<
random_access_index> index_type_list;
typedef mp11::mp_push_front<
typename super::iterator_type_list,
iterator>::type iterator_type_list;
typedef typename mpl::push_front<
iterator> iterator_type_list;
typedef mp11::mp_push_front<
typename super::const_iterator_type_list,
const_iterator>::type const_iterator_type_list;
const_iterator> const_iterator_type_list;
typedef typename super::copy_map_type copy_map_type;

#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
Expand Down Expand Up @@ -198,7 +199,7 @@ class random_access_index:
template <class InputIterator>
void assign(InputIterator first,InputIterator last)
{
assign_iter(first,last,mpl::not_<is_integral<InputIterator> >());
assign_iter(first,last,mp11::mp_not<is_integral<InputIterator> >());
}

#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
Expand Down Expand Up @@ -380,7 +381,7 @@ class random_access_index:
template<typename InputIterator>
void insert(iterator position,InputIterator first,InputIterator last)
{
insert_iter(position,first,last,mpl::not_<is_integral<InputIterator> >());
insert_iter(position,first,last,mp11::mp_not<is_integral<InputIterator> >());
}

#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
Expand Down Expand Up @@ -956,14 +957,14 @@ class random_access_index:
#endif

template <class InputIterator>
void assign_iter(InputIterator first,InputIterator last,mpl::true_)
void assign_iter(InputIterator first,InputIterator last,std::true_type)
{
BOOST_MULTI_INDEX_RND_INDEX_CHECK_INVARIANT;
clear();
for(;first!=last;++first)this->final_insert_ref_(*first);
}

void assign_iter(size_type n,value_param_type value,mpl::false_)
void assign_iter(size_type n,value_param_type value,std::false_type)
{
BOOST_MULTI_INDEX_RND_INDEX_CHECK_INVARIANT;
clear();
Expand All @@ -972,7 +973,7 @@ class random_access_index:

template<typename InputIterator>
void insert_iter(
iterator position,InputIterator first,InputIterator last,mpl::true_)
iterator position,InputIterator first,InputIterator last,std::true_type)
{
BOOST_MULTI_INDEX_RND_INDEX_CHECK_INVARIANT;
size_type s=0;
Expand All @@ -990,7 +991,7 @@ class random_access_index:
}

void insert_iter(
iterator position,size_type n,value_param_type x,mpl::false_)
iterator position,size_type n,value_param_type x,std::false_type)
{
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(position);
BOOST_MULTI_INDEX_CHECK_IS_OWNER(position,*this);
Expand Down Expand Up @@ -1142,8 +1143,7 @@ struct random_access
template<typename SuperMeta>
struct index_class
{
typedef detail::random_access_index<
SuperMeta,typename TagList::type> type;
typedef detail::random_access_index<SuperMeta,TagList> type;
};
};

Expand Down
16 changes: 8 additions & 8 deletions include/boost/multi_index/ranked_index.hpp
Expand Up @@ -128,19 +128,19 @@ class ranked_index:public OrderedIndexImpl
std::pair<std::size_t,std::size_t>
range_rank(LowerBounder lower,UpperBounder upper)const
{
typedef typename mpl::if_<
typedef mp11::mp_if<
is_same<LowerBounder,unbounded_type>,
BOOST_DEDUCED_TYPENAME mpl::if_<
mp11::mp_if<
is_same<UpperBounder,unbounded_type>,
both_unbounded_tag,
lower_unbounded_tag
>::type,
BOOST_DEDUCED_TYPENAME mpl::if_<
>,
mp11::mp_if<
is_same<UpperBounder,unbounded_type>,
upper_unbounded_tag,
none_unbounded_tag
>::type
>::type dispatch;
>
> dispatch;

return range_rank(lower,upper,dispatch());
}
Expand Down Expand Up @@ -330,7 +330,7 @@ struct ranked_unique
{
typedef typename detail::ordered_index_args<
Arg1,Arg2,Arg3> index_args;
typedef typename index_args::tag_list_type::type tag_list_type;
typedef typename index_args::tag_list_type tag_list_type;
typedef typename index_args::key_from_value_type key_from_value_type;
typedef typename index_args::compare_type compare_type;

Expand All @@ -355,7 +355,7 @@ struct ranked_non_unique
{
typedef detail::ordered_index_args<
Arg1,Arg2,Arg3> index_args;
typedef typename index_args::tag_list_type::type tag_list_type;
typedef typename index_args::tag_list_type tag_list_type;
typedef typename index_args::key_from_value_type key_from_value_type;
typedef typename index_args::compare_type compare_type;

Expand Down
6 changes: 3 additions & 3 deletions include/boost/multi_index/ranked_index_fwd.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -22,10 +22,10 @@ namespace multi_index{

/* ranked_index specifiers */

template<typename Arg1,typename Arg2=mpl::na,typename Arg3=mpl::na>
template<typename Arg1,typename Arg2=void,typename Arg3=void>
struct ranked_unique;

template<typename Arg1,typename Arg2=mpl::na,typename Arg3=mpl::na>
template<typename Arg1,typename Arg2=void,typename Arg3=void>
struct ranked_non_unique;

} /* namespace multi_index */
Expand Down
33 changes: 17 additions & 16 deletions include/boost/multi_index/sequenced_index.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -23,9 +23,9 @@
#include <boost/iterator/reverse_iterator.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility.hpp>
#include <boost/mp11/list.hpp>
#include <boost/mp11/function.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/push_front.hpp>
#include <boost/multi_index/detail/access_specifier.hpp>
#include <boost/multi_index/detail/bidir_node_iterator.hpp>
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
Expand All @@ -40,6 +40,7 @@
#include <boost/type_traits/is_integral.hpp>
#include <cstddef>
#include <functional>
#include <type_traits>
#include <utility>

#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
Expand Down Expand Up @@ -133,15 +134,15 @@ class sequenced_index:
typedef tuples::cons<
ctor_args,
typename super::ctor_args_list> ctor_args_list;
typedef typename mpl::push_front<
typedef mp11::mp_push_front<
typename super::index_type_list,
sequenced_index>::type index_type_list;
typedef typename mpl::push_front<
sequenced_index> index_type_list;
typedef mp11::mp_push_front<
typename super::iterator_type_list,
iterator>::type iterator_type_list;
typedef typename mpl::push_front<
iterator> iterator_type_list;
typedef mp11::mp_push_front<
typename super::const_iterator_type_list,
const_iterator>::type const_iterator_type_list;
const_iterator> const_iterator_type_list;
typedef typename super::copy_map_type copy_map_type;

#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
Expand Down Expand Up @@ -189,7 +190,7 @@ class sequenced_index:
template <class InputIterator>
void assign(InputIterator first,InputIterator last)
{
assign_iter(first,last,mpl::not_<is_integral<InputIterator> >());
assign_iter(first,last,mp11::mp_not<is_integral<InputIterator> >());
}

#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
Expand Down Expand Up @@ -336,7 +337,7 @@ class sequenced_index:
template<typename InputIterator>
void insert(iterator position,InputIterator first,InputIterator last)
{
insert_iter(position,first,last,mpl::not_<is_integral<InputIterator> >());
insert_iter(position,first,last,mp11::mp_not<is_integral<InputIterator> >());
}

#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
Expand Down Expand Up @@ -870,14 +871,14 @@ class sequenced_index:
#endif

template <class InputIterator>
void assign_iter(InputIterator first,InputIterator last,mpl::true_)
void assign_iter(InputIterator first,InputIterator last,std::true_type)
{
BOOST_MULTI_INDEX_SEQ_INDEX_CHECK_INVARIANT;
clear();
for(;first!=last;++first)this->final_insert_ref_(*first);
}

void assign_iter(size_type n,value_param_type value,mpl::false_)
void assign_iter(size_type n,value_param_type value,std::false_type)
{
BOOST_MULTI_INDEX_SEQ_INDEX_CHECK_INVARIANT;
clear();
Expand All @@ -886,7 +887,7 @@ class sequenced_index:

template<typename InputIterator>
void insert_iter(
iterator position,InputIterator first,InputIterator last,mpl::true_)
iterator position,InputIterator first,InputIterator last,std::true_type)
{
BOOST_MULTI_INDEX_SEQ_INDEX_CHECK_INVARIANT;
for(;first!=last;++first){
Expand All @@ -899,7 +900,7 @@ class sequenced_index:
}

void insert_iter(
iterator position,size_type n,value_param_type x,mpl::false_)
iterator position,size_type n,value_param_type x,std::false_type)
{
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(position);
BOOST_MULTI_INDEX_CHECK_IS_OWNER(position,*this);
Expand Down Expand Up @@ -1038,7 +1039,7 @@ struct sequenced
template<typename SuperMeta>
struct index_class
{
typedef detail::sequenced_index<SuperMeta,typename TagList::type> type;
typedef detail::sequenced_index<SuperMeta,TagList> type;
};
};

Expand Down
47 changes: 5 additions & 42 deletions include/boost/multi_index/tag.hpp
@@ -1,4 +1,4 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -15,34 +15,13 @@

#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/multi_index/detail/no_duplicate_tags.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/transform.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/preprocessor/facilities/intercept.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_base_and_derived.hpp>

/* A wrapper of mpl::vector used to hide MPL from the user.
* tag contains types used as tag names for indices in get() functions.
/* A Mp11 list containing types used as tag names for indices in get()
* functions.
*/

/* This user_definable macro limits the number of elements of a tag;
* useful for shortening resulting symbol names (MSVC++ 6.0, for instance,
* has problems coping with very long symbol names.)
*/

#if !defined(BOOST_MULTI_INDEX_LIMIT_TAG_SIZE)
#define BOOST_MULTI_INDEX_LIMIT_TAG_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE
#endif

#if BOOST_MULTI_INDEX_LIMIT_TAG_SIZE<BOOST_MPL_LIMIT_VECTOR_SIZE
#define BOOST_MULTI_INDEX_TAG_SIZE BOOST_MULTI_INDEX_LIMIT_TAG_SIZE
#else
#define BOOST_MULTI_INDEX_TAG_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE
#endif

namespace boost{

namespace multi_index{
Expand All @@ -59,30 +38,14 @@ struct is_tag

} /* namespace multi_index::detail */

template<
BOOST_PP_ENUM_BINARY_PARAMS(
BOOST_MULTI_INDEX_TAG_SIZE,
typename T,
=mpl::na BOOST_PP_INTERCEPT)
>
template<typename... T>
struct tag:private detail::tag_marker
{
/* The mpl::transform pass produces shorter symbols (without
* trailing mpl::na's.)
*/

typedef typename mpl::transform<
mpl::vector<BOOST_PP_ENUM_PARAMS(BOOST_MULTI_INDEX_TAG_SIZE,T)>,
mpl::identity<mpl::_1>
>::type type;

BOOST_STATIC_ASSERT(detail::no_duplicate_tags<type>::value);
BOOST_STATIC_ASSERT(detail::no_duplicate_tags<tag>::value);
};

} /* namespace multi_index */

} /* namespace boost */

#undef BOOST_MULTI_INDEX_TAG_SIZE

#endif
86 changes: 41 additions & 45 deletions include/boost/multi_index_container.hpp
@@ -1,6 +1,6 @@
/* Multiply indexed container.
*
* Copyright 2003-2014 Joaquin M Lopez Munoz.
* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -21,13 +21,9 @@
#include <boost/detail/no_exceptions_support.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/move/core.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/contains.hpp>
#include <boost/mpl/find_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/size.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mp11/algorithm.hpp>
#include <boost/mp11/list.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/multi_index_container_fwd.hpp>
#include <boost/multi_index/detail/access_specifier.hpp>
#include <boost/multi_index/detail/adl_swap.hpp>
Expand Down Expand Up @@ -165,10 +161,10 @@ class multi_index_container:
*/

const ctor_args_list& args_list=
typename mpl::identity<multi_index_container>::type::
typename mp11::mp_identity<multi_index_container>::type::
ctor_args_list(),
const allocator_type& al=
typename mpl::identity<multi_index_container>::type::
typename mp11::mp_identity<multi_index_container>::type::
allocator_type()):
#else
const ctor_args_list& args_list=ctor_args_list(),
Expand Down Expand Up @@ -200,10 +196,10 @@ class multi_index_container:
*/

const ctor_args_list& args_list=
typename mpl::identity<multi_index_container>::type::
typename mp11::mp_identity<multi_index_container>::type::
ctor_args_list(),
const allocator_type& al=
typename mpl::identity<multi_index_container>::type::
typename mp11::mp_identity<multi_index_container>::type::
allocator_type()):
#else
const ctor_args_list& args_list=ctor_args_list(),
Expand Down Expand Up @@ -355,21 +351,21 @@ class multi_index_container:
template<int N>
struct nth_index
{
BOOST_STATIC_ASSERT(N>=0&&N<mpl::size<index_type_list>::type::value);
typedef typename mpl::at_c<index_type_list,N>::type type;
BOOST_STATIC_ASSERT(N>=0&&N<mp11::mp_size<index_type_list>::value);
typedef mp11::mp_at_c<index_type_list,N> type;
};

template<int N>
typename nth_index<N>::type& get()BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT(N>=0&&N<mpl::size<index_type_list>::type::value);
BOOST_STATIC_ASSERT(N>=0&&N<mp11::mp_size<index_type_list>::value);
return *this;
}

template<int N>
const typename nth_index<N>::type& get()const BOOST_NOEXCEPT
{
BOOST_STATIC_ASSERT(N>=0&&N<mpl::size<index_type_list>::type::value);
BOOST_STATIC_ASSERT(N>=0&&N<mp11::mp_size<index_type_list>::value);
return *this;
}
#endif
Expand All @@ -380,16 +376,16 @@ class multi_index_container:
template<typename Tag>
struct index
{
typedef typename mpl::find_if<
typedef mp11::mp_find_if<
index_type_list,
detail::has_tag<Tag>
>::type iter;
typename detail::has_tag<Tag>::fn
> pos;

BOOST_STATIC_CONSTANT(
bool,index_found=!(is_same<iter,typename mpl::end<index_type_list>::type >::value));
bool,index_found=(pos::value<mp11::mp_size<index_type_list>::value));
BOOST_STATIC_ASSERT(index_found);

typedef typename mpl::deref<iter>::type type;
typedef mp11::mp_at<index_type_list,pos> type;
};

template<typename Tag>
Expand Down Expand Up @@ -427,7 +423,7 @@ class multi_index_container:

#if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* fails in Sun C++ 5.7 */
BOOST_STATIC_ASSERT(
(mpl::contains<iterator_type_list,IteratorType>::value));
(mp11::mp_contains<iterator_type_list,IteratorType>::value));
#endif

BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(it);
Expand All @@ -444,8 +440,8 @@ class multi_index_container:

#if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* fails in Sun C++ 5.7 */
BOOST_STATIC_ASSERT((
mpl::contains<iterator_type_list,IteratorType>::value||
mpl::contains<const_iterator_type_list,IteratorType>::value));
mp11::mp_contains<iterator_type_list,IteratorType>::value||
mp11::mp_contains<const_iterator_type_list,IteratorType>::value));
#endif

BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(it);
Expand Down Expand Up @@ -477,7 +473,7 @@ class multi_index_container:

#if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* fails in Sun C++ 5.7 */
BOOST_STATIC_ASSERT(
(mpl::contains<iterator_type_list,IteratorType>::value));
(mp11::mp_contains<iterator_type_list,IteratorType>::value));
#endif

BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(it);
Expand All @@ -493,8 +489,8 @@ class multi_index_container:

#if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* fails in Sun C++ 5.7 */
BOOST_STATIC_ASSERT((
mpl::contains<iterator_type_list,IteratorType>::value||
mpl::contains<const_iterator_type_list,IteratorType>::value));
mp11::mp_contains<iterator_type_list,IteratorType>::value||
mp11::mp_contains<const_iterator_type_list,IteratorType>::value));
#endif

BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(it);
Expand Down Expand Up @@ -969,10 +965,10 @@ struct nth_index
{
BOOST_STATIC_CONSTANT(
int,
M=mpl::size<typename MultiIndexContainer::index_type_list>::type::value);
M=mp11::mp_size<typename MultiIndexContainer::index_type_list>::value);
BOOST_STATIC_ASSERT(N>=0&&N<M);
typedef typename mpl::at_c<
typename MultiIndexContainer::index_type_list,N>::type type;
typedef mp11::mp_at_c<
typename MultiIndexContainer::index_type_list,N> type;
};

template<int N,typename Value,typename IndexSpecifierList,typename Allocator>
Expand All @@ -991,9 +987,9 @@ get(

BOOST_STATIC_ASSERT(N>=0&&
N<
mpl::size<
mp11::mp_size<
BOOST_DEDUCED_TYPENAME multi_index_type::index_type_list
>::type::value);
>::value);

return detail::converter<multi_index_type,index_type>::index(m);
}
Expand All @@ -1015,9 +1011,9 @@ get(

BOOST_STATIC_ASSERT(N>=0&&
N<
mpl::size<
mp11::mp_size<
BOOST_DEDUCED_TYPENAME multi_index_type::index_type_list
>::type::value);
>::value);

return detail::converter<multi_index_type,index_type>::index(m);
}
Expand All @@ -1029,16 +1025,16 @@ struct index
{
typedef typename MultiIndexContainer::index_type_list index_type_list;

typedef typename mpl::find_if<
typedef mp11::mp_find_if<
index_type_list,
detail::has_tag<Tag>
>::type iter;
typename detail::has_tag<Tag>::fn
> pos;

BOOST_STATIC_CONSTANT(
bool,index_found=!(is_same<iter,typename mpl::end<index_type_list>::type >::value));
bool,index_found=(pos::value<mp11::mp_size<index_type_list>::value));
BOOST_STATIC_ASSERT(index_found);

typedef typename mpl::deref<iter>::type type;
typedef mp11::mp_at<index_type_list,pos> type;
};

template<
Expand Down Expand Up @@ -1109,7 +1105,7 @@ project(

#if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* Sun C++ 5.7 fails */
BOOST_STATIC_ASSERT((
mpl::contains<
mp11::mp_contains<
BOOST_DEDUCED_TYPENAME multi_index_type::iterator_type_list,
IteratorType>::value));
#endif
Expand Down Expand Up @@ -1142,10 +1138,10 @@ project(

#if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* Sun C++ 5.7 fails */
BOOST_STATIC_ASSERT((
mpl::contains<
mp11::mp_contains<
BOOST_DEDUCED_TYPENAME multi_index_type::iterator_type_list,
IteratorType>::value||
mpl::contains<
mp11::mp_contains<
BOOST_DEDUCED_TYPENAME multi_index_type::const_iterator_type_list,
IteratorType>::value));
#endif
Expand Down Expand Up @@ -1195,7 +1191,7 @@ project(

#if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* Sun C++ 5.7 fails */
BOOST_STATIC_ASSERT((
mpl::contains<
mp11::mp_contains<
BOOST_DEDUCED_TYPENAME multi_index_type::iterator_type_list,
IteratorType>::value));
#endif
Expand Down Expand Up @@ -1229,10 +1225,10 @@ project(

#if !defined(__SUNPRO_CC)||!(__SUNPRO_CC<0x580) /* Sun C++ 5.7 fails */
BOOST_STATIC_ASSERT((
mpl::contains<
mp11::mp_contains<
BOOST_DEDUCED_TYPENAME multi_index_type::iterator_type_list,
IteratorType>::value||
mpl::contains<
mp11::mp_contains<
BOOST_DEDUCED_TYPENAME multi_index_type::const_iterator_type_list,
IteratorType>::value));
#endif
Expand Down
10 changes: 4 additions & 6 deletions test/employee.hpp
@@ -1,6 +1,6 @@
/* Used in Boost.MultiIndex tests.
*
* Copyright 2003-2015 Joaquin M Lopez Munoz.
* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -14,7 +14,6 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/move/core.hpp>
#include <boost/move/utility.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/identity.hpp>
Expand Down Expand Up @@ -103,8 +102,8 @@ struct as_inserted{};
struct ssn{};
struct randomly{};

struct employee_set_indices:
boost::mpl::vector<
using employee_set_indices=
boost::multi_index::indexed_by<
boost::multi_index::ordered_unique<
boost::multi_index::identity<employee> >,
boost::multi_index::hashed_non_unique<
Expand All @@ -119,8 +118,7 @@ struct employee_set_indices:
boost::multi_index::tag<ssn>,
BOOST_MULTI_INDEX_MEMBER(employee,int,ssn)>,
boost::multi_index::random_access<
boost::multi_index::tag<randomly> > >
{};
boost::multi_index::tag<randomly> > >;

typedef
boost::multi_index::multi_index_container<
Expand Down
19 changes: 10 additions & 9 deletions test/test_composite_key.cpp
@@ -1,6 +1,6 @@
/* Boost.MultiIndex test for composite_key.
*
* Copyright 2003-2014 Joaquin M Lopez Munoz.
* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -13,6 +13,7 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/detail/lightweight_test.hpp>
#include "pre_multi_index.hpp"
#include <boost/mp11/utility.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/composite_key.hpp>
#include <boost/multi_index/hashed_index.hpp>
Expand Down Expand Up @@ -84,27 +85,27 @@ struct is_boost_tuple
template<typename T>
struct composite_object_length
{
typedef typename boost::mpl::if_c<
typedef boost::mp11::mp_if_c<
is_composite_key_result<T>::value,
composite_key_result_length<T>,
typename boost::mpl::if_c<
boost::mp11::mp_if_c<
is_boost_tuple<T>::value,
boost::tuples::length<T>,
std::tuple_size<T>
>::type
>::type type;
>
> type;

BOOST_STATIC_CONSTANT(int,value=type::value);
};
#else
template<typename T>
struct composite_object_length
{
typedef typename boost::mpl::if_c<
typedef boost::mp11::mp_if_c<
is_composite_key_result<T>::value,
composite_key_result_length<T>,
boost::tuples::length<T>
>::type type;
> type;

BOOST_STATIC_CONSTANT(int,value=type::value);
};
Expand Down Expand Up @@ -240,12 +241,12 @@ struct comparison_different_length

template<typename CompositeKeyResult,typename T2>
struct comparison_helper:
boost::mpl::if_c<
boost::mp11::mp_if_c<
composite_key_result_length<CompositeKeyResult>::value==
composite_object_length<T2>::value,
comparison_equal_length<CompositeKeyResult,T2>,
comparison_different_length<CompositeKeyResult,T2>
>::type
>
{
};

Expand Down
36 changes: 18 additions & 18 deletions test/test_mpl_ops.cpp
@@ -1,6 +1,6 @@
/* Boost.MultiIndex test for MPL operations.
/* Boost.MultiIndex test for Mp11 operations.
*
* Copyright 2003-2008 Joaquin M Lopez Munoz.
* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -16,8 +16,8 @@
#include <boost/multi_index/identity.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/list.hpp>
#include <boost/mp11/algorithm.hpp>
#include <boost/mp11/list.hpp>

using namespace boost::multi_index;

Expand All @@ -32,44 +32,44 @@ void test_mpl_ops()
> indexed_t1;

BOOST_STATIC_ASSERT((boost::is_same<
boost::mpl::at_c<indexed_t1::index_specifier_type_list,0>::type,
boost::mp11::mp_at_c<indexed_t1::index_specifier_type_list,0>,
ordered_unique<identity<int> > >::value));
BOOST_STATIC_ASSERT((boost::is_same<
boost::mpl::at_c<indexed_t1::index_specifier_type_list,1>::type,
boost::mp11::mp_at_c<indexed_t1::index_specifier_type_list,1>,
ordered_non_unique<identity<int> > >::value));

typedef boost::mpl::push_front<
typedef boost::mp11::mp_push_front<
indexed_t1::index_specifier_type_list,
sequenced<>
>::type index_list_t;
> index_list_t;

typedef multi_index_container<
int,
index_list_t
> indexed_t2;

BOOST_STATIC_ASSERT((boost::is_same<
boost::mpl::at_c<indexed_t2::index_specifier_type_list,0>::type,
boost::mp11::mp_at_c<indexed_t2::index_specifier_type_list,0>,
sequenced<> >::value));
BOOST_STATIC_ASSERT((boost::is_same<
boost::mpl::at_c<indexed_t2::index_specifier_type_list,1>::type,
boost::mpl::at_c<indexed_t1::index_specifier_type_list,0>::type>::value));
boost::mp11::mp_at_c<indexed_t2::index_specifier_type_list,1>,
boost::mp11::mp_at_c<indexed_t1::index_specifier_type_list,0> >::value));
BOOST_STATIC_ASSERT((boost::is_same<
boost::mpl::at_c<indexed_t2::index_specifier_type_list,2>::type,
boost::mpl::at_c<indexed_t1::index_specifier_type_list,1>::type>::value));
boost::mp11::mp_at_c<indexed_t2::index_specifier_type_list,2>,
boost::mp11::mp_at_c<indexed_t1::index_specifier_type_list,1> >::value));

typedef multi_index_container<
int,
boost::mpl::list<
boost::mp11::mp_list<
ordered_unique<identity<int> >,
ordered_non_unique<identity<int> >
>
> indexed_t3;

BOOST_STATIC_ASSERT((boost::is_same<
boost::mpl::at_c<indexed_t3::index_specifier_type_list,0>::type,
boost::mpl::at_c<indexed_t1::index_specifier_type_list,0>::type>::value));
boost::mp11::mp_at_c<indexed_t3::index_specifier_type_list,0>,
boost::mp11::mp_at_c<indexed_t1::index_specifier_type_list,0> >::value));
BOOST_STATIC_ASSERT((boost::is_same<
boost::mpl::at_c<indexed_t3::index_specifier_type_list,1>::type,
boost::mpl::at_c<indexed_t1::index_specifier_type_list,1>::type>::value));
boost::mp11::mp_at_c<indexed_t3::index_specifier_type_list,1>,
boost::mp11::mp_at_c<indexed_t1::index_specifier_type_list,1> >::value));
}
8 changes: 4 additions & 4 deletions test/test_serialization_template.hpp
@@ -1,6 +1,6 @@
/* Boost.MultiIndex serialization tests template.
*
* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Copyright 2003-2017 Joaquin M Lopez Munoz.
* 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)
Expand All @@ -12,7 +12,7 @@
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/mpl/size.hpp>
#include <boost/mp11/list.hpp>
#include "pre_multi_index.hpp"
#include <boost/multi_index_container.hpp>
#include <string>
Expand Down Expand Up @@ -49,8 +49,8 @@ bool all_indices_equal(
const MultiIndexContainer& m1,const MultiIndexContainer& m2)
{
BOOST_STATIC_CONSTANT(int,
N=boost::mpl::size<
BOOST_DEDUCED_TYPENAME MultiIndexContainer::index_type_list>::type::value);
N=boost::mp11::mp_size<
BOOST_DEDUCED_TYPENAME MultiIndexContainer::index_type_list>::value);

return all_indices_equal_helper<N-1>::compare(m1,m2);
}
Expand Down