Chris@16
|
1
|
Chris@16
|
2 // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
|
Chris@16
|
3
|
Chris@16
|
4 #if !defined(BOOST_PP_IS_ITERATING)
|
Chris@16
|
5
|
Chris@16
|
6 // Copyright Aleksey Gurtovoy 2000-2004
|
Chris@16
|
7 //
|
Chris@16
|
8 // Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
9 // (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
10 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
11 //
|
Chris@16
|
12 // See http://www.boost.org/libs/mpl for documentation.
|
Chris@16
|
13
|
Chris@101
|
14 // $Id$
|
Chris@101
|
15 // $Date$
|
Chris@101
|
16 // $Revision$
|
Chris@16
|
17
|
Chris@16
|
18 #else
|
Chris@16
|
19
|
Chris@16
|
20 #include <boost/mpl/aux_/config/typeof.hpp>
|
Chris@16
|
21 #include <boost/mpl/aux_/config/ctps.hpp>
|
Chris@16
|
22 #include <boost/preprocessor/enum_params.hpp>
|
Chris@16
|
23 #include <boost/preprocessor/dec.hpp>
|
Chris@16
|
24 #include <boost/preprocessor/cat.hpp>
|
Chris@16
|
25
|
Chris@16
|
26 #define i_ BOOST_PP_FRAME_ITERATION(1)
|
Chris@16
|
27
|
Chris@16
|
28 # define AUX778076_MAP_TAIL(map, i_, P) \
|
Chris@16
|
29 BOOST_PP_CAT(map,i_)< \
|
Chris@16
|
30 BOOST_PP_ENUM_PARAMS(i_, P) \
|
Chris@16
|
31 > \
|
Chris@16
|
32 /**/
|
Chris@16
|
33
|
Chris@16
|
34
|
Chris@16
|
35 #if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
|
Chris@16
|
36
|
Chris@16
|
37 template<
|
Chris@16
|
38 BOOST_PP_ENUM_PARAMS(i_, typename P)
|
Chris@16
|
39 >
|
Chris@16
|
40 struct BOOST_PP_CAT(map,i_)
|
Chris@16
|
41 : m_item<
|
Chris@16
|
42 typename BOOST_PP_CAT(P,BOOST_PP_DEC(i_))::first
|
Chris@16
|
43 , typename BOOST_PP_CAT(P,BOOST_PP_DEC(i_))::second
|
Chris@16
|
44 , AUX778076_MAP_TAIL(map,BOOST_PP_DEC(i_),P)
|
Chris@16
|
45 >
|
Chris@16
|
46 {
|
Chris@16
|
47 typedef BOOST_PP_CAT(map,i_) type;
|
Chris@16
|
48 };
|
Chris@16
|
49
|
Chris@16
|
50 #else // "brute force" implementation
|
Chris@16
|
51
|
Chris@16
|
52 # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
Chris@16
|
53
|
Chris@16
|
54 template< typename Map>
|
Chris@16
|
55 struct m_at<Map,BOOST_PP_DEC(i_)>
|
Chris@16
|
56 {
|
Chris@16
|
57 typedef typename Map::BOOST_PP_CAT(item,BOOST_PP_DEC(i_)) type;
|
Chris@16
|
58 };
|
Chris@16
|
59
|
Chris@16
|
60 template< typename Key, typename T, typename Base >
|
Chris@16
|
61 struct m_item<i_,Key,T,Base>
|
Chris@16
|
62 : m_item_<Key,T,Base>
|
Chris@16
|
63 {
|
Chris@16
|
64 typedef pair<Key,T> BOOST_PP_CAT(item,BOOST_PP_DEC(i_));
|
Chris@16
|
65 };
|
Chris@16
|
66
|
Chris@16
|
67 # else
|
Chris@16
|
68
|
Chris@16
|
69 template<>
|
Chris@16
|
70 struct m_at_impl<BOOST_PP_DEC(i_)>
|
Chris@16
|
71 {
|
Chris@16
|
72 template< typename Map > struct result_
|
Chris@16
|
73 {
|
Chris@16
|
74 typedef typename Map::BOOST_PP_CAT(item,BOOST_PP_DEC(i_)) type;
|
Chris@16
|
75 };
|
Chris@16
|
76 };
|
Chris@16
|
77
|
Chris@16
|
78 template<>
|
Chris@16
|
79 struct m_item_impl<i_>
|
Chris@16
|
80 {
|
Chris@16
|
81 template< typename Key, typename T, typename Base > struct result_
|
Chris@16
|
82 : m_item_<Key,T,Base>
|
Chris@16
|
83 {
|
Chris@16
|
84 typedef pair<Key,T> BOOST_PP_CAT(item,BOOST_PP_DEC(i_));
|
Chris@16
|
85 };
|
Chris@16
|
86 };
|
Chris@16
|
87
|
Chris@16
|
88 # endif
|
Chris@16
|
89
|
Chris@16
|
90 template<
|
Chris@16
|
91 BOOST_PP_ENUM_PARAMS(i_, typename P)
|
Chris@16
|
92 >
|
Chris@16
|
93 struct BOOST_PP_CAT(map,i_)
|
Chris@16
|
94 : m_item<
|
Chris@16
|
95 i_
|
Chris@16
|
96 , typename BOOST_PP_CAT(P,BOOST_PP_DEC(i_))::first
|
Chris@16
|
97 , typename BOOST_PP_CAT(P,BOOST_PP_DEC(i_))::second
|
Chris@16
|
98 , AUX778076_MAP_TAIL(map,BOOST_PP_DEC(i_),P)
|
Chris@16
|
99 >
|
Chris@16
|
100 {
|
Chris@16
|
101 typedef BOOST_PP_CAT(map,i_) type;
|
Chris@16
|
102 };
|
Chris@16
|
103
|
Chris@16
|
104 #endif // BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES
|
Chris@16
|
105
|
Chris@16
|
106 # undef AUX778076_MAP_TAIL
|
Chris@16
|
107
|
Chris@16
|
108 #undef i_
|
Chris@16
|
109
|
Chris@16
|
110 #endif // BOOST_PP_IS_ITERATING
|