1 /* Copyright 2003-2013 Joaquin M Lopez Munoz.
2 * Distributed under the Boost Software License, Version 1.0.
3 * (See accompanying file LICENSE_1_0.txt or copy at
4 * http://www.boost.org/LICENSE_1_0.txt)
6 * See http://www.boost.org/libs/multi_index for library home page.
9 #ifndef BOOST_MULTI_INDEX_DETAIL_NODE_TYPE_HPP
10 #define BOOST_MULTI_INDEX_DETAIL_NODE_TYPE_HPP
16 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
17 #include <boost/detail/workaround.hpp>
18 #include <boost/mpl/bind.hpp>
19 #include <boost/mpl/reverse_iter_fold.hpp>
20 #include <boost/mpl/deref.hpp>
21 #include <boost/multi_index_container_fwd.hpp>
22 #include <boost/multi_index/detail/header_holder.hpp>
23 #include <boost/multi_index/detail/index_node_base.hpp>
24 #include <boost/multi_index/detail/is_index_list.hpp>
25 #include <boost/static_assert.hpp>
29 namespace multi_index{
33 /* MPL machinery to construct the internal node type associated to an
37 struct index_node_applier
39 template<typename IndexSpecifierIterator,typename Super>
42 typedef typename mpl::deref<IndexSpecifierIterator>::type index_specifier;
43 typedef typename index_specifier::
44 BOOST_NESTED_TEMPLATE node_class<Super>::type type;
48 template<typename Value,typename IndexSpecifierList,typename Allocator>
49 struct multi_index_node_type
51 BOOST_STATIC_ASSERT(detail::is_index_list<IndexSpecifierList>::value);
53 typedef typename mpl::reverse_iter_fold<
55 index_node_base<Value,Allocator>,
56 mpl::bind2<index_node_applier,mpl::_2,mpl::_1>
60 } /* namespace multi_index::detail */
62 } /* namespace multi_index */
64 } /* namespace boost */