2 // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
4 #if !defined(BOOST_PP_IS_ITERATING)
6 // Copyright Aleksey Gurtovoy 2000-2004
8 // Distributed under the Boost Software License, Version 1.0.
9 // (See accompanying file LICENSE_1_0.txt or copy at
10 // http://www.boost.org/LICENSE_1_0.txt)
12 // See http://www.boost.org/libs/mpl for documentation.
20 #include <boost/mpl/aux_/config/typeof.hpp>
21 #include <boost/mpl/aux_/config/ctps.hpp>
22 #include <boost/preprocessor/enum_params.hpp>
23 #include <boost/preprocessor/dec.hpp>
24 #include <boost/preprocessor/cat.hpp>
26 #define i_ BOOST_PP_FRAME_ITERATION(1)
28 # define AUX778076_MAP_TAIL(map, i_, P) \
29 BOOST_PP_CAT(map,i_)< \
30 BOOST_PP_ENUM_PARAMS(i_, P) \
35 #if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
38 BOOST_PP_ENUM_PARAMS(i_, typename P)
40 struct BOOST_PP_CAT(map,i_)
42 typename BOOST_PP_CAT(P,BOOST_PP_DEC(i_))::first
43 , typename BOOST_PP_CAT(P,BOOST_PP_DEC(i_))::second
44 , AUX778076_MAP_TAIL(map,BOOST_PP_DEC(i_),P)
47 typedef BOOST_PP_CAT(map,i_) type;
50 #else // "brute force" implementation
52 # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
54 template< typename Map>
55 struct m_at<Map,BOOST_PP_DEC(i_)>
57 typedef typename Map::BOOST_PP_CAT(item,BOOST_PP_DEC(i_)) type;
60 template< typename Key, typename T, typename Base >
61 struct m_item<i_,Key,T,Base>
64 typedef pair<Key,T> BOOST_PP_CAT(item,BOOST_PP_DEC(i_));
70 struct m_at_impl<BOOST_PP_DEC(i_)>
72 template< typename Map > struct result_
74 typedef typename Map::BOOST_PP_CAT(item,BOOST_PP_DEC(i_)) type;
79 struct m_item_impl<i_>
81 template< typename Key, typename T, typename Base > struct result_
84 typedef pair<Key,T> BOOST_PP_CAT(item,BOOST_PP_DEC(i_));
91 BOOST_PP_ENUM_PARAMS(i_, typename P)
93 struct BOOST_PP_CAT(map,i_)
96 , typename BOOST_PP_CAT(P,BOOST_PP_DEC(i_))::first
97 , typename BOOST_PP_CAT(P,BOOST_PP_DEC(i_))::second
98 , AUX778076_MAP_TAIL(map,BOOST_PP_DEC(i_),P)
101 typedef BOOST_PP_CAT(map,i_) type;
104 #endif // BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES
106 # undef AUX778076_MAP_TAIL
110 #endif // BOOST_PP_IS_ITERATING