#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS #define BOOST_MPL_LIMIT_MAP_SIZE 40 #include #include #include #include #include struct a1_t {}; struct a2_t {}; struct a3_t {}; struct a4_t {}; struct a5_t {}; struct a6_t {}; struct a7_t {}; struct a8_t {}; struct a9_t {}; struct b1_t {}; struct b2_t {}; struct b3_t {}; struct b4_t {}; struct b5_t {}; struct b6_t {}; struct b7_t {}; struct b8_t {}; struct b9_t {}; struct c1_t {}; struct c2_t {}; struct c3_t {}; struct c4_t {}; struct c5_t {}; struct c6_t {}; struct c7_t {}; struct c8_t {}; struct c9_t {}; namespace MPL = boost::mpl; typedef MPL::map< MPL::pair< a1_t, MPL::int_< 1 > >, MPL::pair< a2_t, MPL::int_< 2 > >, MPL::pair< a3_t, MPL::int_< 3 > >, MPL::pair< a4_t, MPL::int_< 4 > >, MPL::pair< a5_t, MPL::int_< 5 > >, MPL::pair< a6_t, MPL::int_< 6 > >, MPL::pair< a7_t, MPL::int_< 7 > >, MPL::pair< a8_t, MPL::int_< 8 > >, MPL::pair< a9_t, MPL::int_< 9 > >, MPL::pair< b1_t, MPL::int_< 1 > >, MPL::pair< b2_t, MPL::int_< 2 > >, MPL::pair< b3_t, MPL::int_< 3 > >, MPL::pair< b4_t, MPL::int_< 4 > >, MPL::pair< b5_t, MPL::int_< 5 > >, MPL::pair< b6_t, MPL::int_< 6 > >, MPL::pair< b7_t, MPL::int_< 7 > >, MPL::pair< b8_t, MPL::int_< 8 > >, MPL::pair< b9_t, MPL::int_< 9 > >, MPL::pair< c1_t, MPL::int_< 1 > >/*, MPL::pair< c2_t, MPL::int_< 2 > >, MPL::pair< c3_t, MPL::int_< 3 > >, MPL::pair< c4_t, MPL::int_< 4 > >*/ > type_map; template < typename T > void print_type_value() { typedef typename MPL::at< type_map, T >::type int_t; std::cout << "-> " << int_t::value << std::endl; } int main() { print_type_value< a1_t >(); print_type_value< a2_t >(); typedef MPL::size< type_map >::type map_size_t; std::cout << "MPL map size: " << map_size_t::value << std::endl; }