Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:41:43

0001 
0002 // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
0003 
0004 #if !defined(BOOST_PP_IS_ITERATING)
0005 
0006 // Copyright Aleksey Gurtovoy 2000-2004
0007 //
0008 // Distributed under the Boost Software License, Version 1.0. 
0009 // (See accompanying file LICENSE_1_0.txt or copy at 
0010 // http://www.boost.org/LICENSE_1_0.txt)
0011 //
0012 // See http://www.boost.org/libs/mpl for documentation.
0013 
0014 // $Id$
0015 // $Date$
0016 // $Revision$
0017 
0018 #else
0019 
0020 #include <boost/mpl/aux_/config/typeof.hpp>
0021 #include <boost/mpl/aux_/config/ctps.hpp>
0022 #include <boost/preprocessor/enum_params.hpp>
0023 #include <boost/preprocessor/dec.hpp>
0024 #include <boost/preprocessor/cat.hpp>
0025 
0026 #define i_ BOOST_PP_FRAME_ITERATION(1)
0027 
0028 #   define AUX778076_MAP_TAIL(map, i_, P) \
0029     BOOST_PP_CAT(map,i_)< \
0030           BOOST_PP_ENUM_PARAMS(i_, P) \
0031         > \
0032     /**/
0033 
0034 
0035 #if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
0036 
0037 template<
0038       BOOST_PP_ENUM_PARAMS(i_, typename P)
0039     >
0040 struct BOOST_PP_CAT(map,i_)
0041     : m_item<
0042           typename BOOST_PP_CAT(P,BOOST_PP_DEC(i_))::first
0043         , typename BOOST_PP_CAT(P,BOOST_PP_DEC(i_))::second
0044         , AUX778076_MAP_TAIL(map,BOOST_PP_DEC(i_),P)
0045         >
0046 {
0047     typedef BOOST_PP_CAT(map,i_) type;
0048 };
0049 
0050 #else // "brute force" implementation
0051 
0052 #   if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
0053 
0054 template< typename Map>
0055 struct m_at<Map,BOOST_PP_DEC(i_)>
0056 {
0057     typedef typename Map::BOOST_PP_CAT(item,BOOST_PP_DEC(i_)) type;
0058 };
0059 
0060 template< typename Key, typename T, typename Base >
0061 struct m_item<i_,Key,T,Base>
0062     : m_item_<Key,T,Base>
0063 {
0064     typedef pair<Key,T> BOOST_PP_CAT(item,BOOST_PP_DEC(i_));
0065 };
0066 
0067 #   else
0068 
0069 template<>
0070 struct m_at_impl<BOOST_PP_DEC(i_)>
0071 {
0072     template< typename Map > struct result_
0073     {
0074         typedef typename Map::BOOST_PP_CAT(item,BOOST_PP_DEC(i_)) type;
0075     };
0076 };
0077 
0078 template<>
0079 struct m_item_impl<i_>
0080 {
0081     template< typename Key, typename T, typename Base > struct result_
0082         : m_item_<Key,T,Base>
0083     {
0084         typedef pair<Key,T> BOOST_PP_CAT(item,BOOST_PP_DEC(i_));
0085     };
0086 };
0087 
0088 #   endif
0089 
0090 template<
0091       BOOST_PP_ENUM_PARAMS(i_, typename P)
0092     >
0093 struct BOOST_PP_CAT(map,i_)
0094     : m_item<
0095           i_
0096         , typename BOOST_PP_CAT(P,BOOST_PP_DEC(i_))::first
0097         , typename BOOST_PP_CAT(P,BOOST_PP_DEC(i_))::second
0098         , AUX778076_MAP_TAIL(map,BOOST_PP_DEC(i_),P)
0099         >
0100 {
0101     typedef BOOST_PP_CAT(map,i_) type;
0102 };
0103 
0104 #endif // BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES
0105 
0106 #   undef AUX778076_MAP_TAIL
0107 
0108 #undef i_
0109 
0110 #endif // BOOST_PP_IS_ITERATING