1 /* Copyright 2003-2005 Joaquín M López Muñoz.
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_INDEXED_BY_HPP
10 #define BOOST_MULTI_INDEX_INDEXED_BY_HPP
12 #if defined(_MSC_VER)&&(_MSC_VER>=1200)
16 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
17 #include <boost/mpl/vector.hpp>
18 #include <boost/preprocessor/cat.hpp>
19 #include <boost/preprocessor/control/expr_if.hpp>
20 #include <boost/preprocessor/repetition/enum.hpp>
21 #include <boost/preprocessor/repetition/enum_params.hpp>
23 /* An alias to mpl::vector used to hide MPL from the user.
24 * indexed_by contains the index specifiers for instantiation
25 * of a multi_index_container.
28 /* This user_definable macro limits the number of elements of an index list;
29 * useful for shortening resulting symbol names (MSVC++ 6.0, for instance,
30 * has problems coping with very long symbol names.)
33 #if !defined(BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE)
34 #if defined(BOOST_MSVC)&&(BOOST_MSVC<1300)
35 #define BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE 5
37 #define BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE
41 #if BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE<BOOST_MPL_LIMIT_VECTOR_SIZE
42 #define BOOST_MULTI_INDEX_INDEXED_BY_SIZE \
43 BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE
45 #define BOOST_MULTI_INDEX_INDEXED_BY_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE
48 #define BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM(z,n,var) \
49 typename BOOST_PP_CAT(var,n) BOOST_PP_EXPR_IF(n,=mpl::na)
53 namespace multi_index{
57 BOOST_MULTI_INDEX_INDEXED_BY_SIZE,
58 BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM,T)
61 mpl::vector<BOOST_PP_ENUM_PARAMS(BOOST_MULTI_INDEX_INDEXED_BY_SIZE,T)>
65 } /* namespace multi_index */
67 } /* namespace boost */
69 #undef BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM
70 #undef BOOST_MULTI_INDEX_INDEXED_BY_SIZE