Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:48:21

0001 /* Copyright 2003-2013 Joaquin M Lopez Munoz.
0002  * Distributed under the Boost Software License, Version 1.0.
0003  * (See accompanying file LICENSE_1_0.txt or copy at
0004  * http://www.boost.org/LICENSE_1_0.txt)
0005  *
0006  * See http://www.boost.org/libs/multi_index for library home page.
0007  */
0008 
0009 #ifndef BOOST_MULTI_INDEX_INDEXED_BY_HPP
0010 #define BOOST_MULTI_INDEX_INDEXED_BY_HPP
0011 
0012 #if defined(_MSC_VER)
0013 #pragma once
0014 #endif
0015 
0016 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
0017 #include <boost/mpl/vector.hpp>
0018 #include <boost/preprocessor/cat.hpp>
0019 #include <boost/preprocessor/control/expr_if.hpp>
0020 #include <boost/preprocessor/repetition/enum.hpp>
0021 #include <boost/preprocessor/repetition/enum_params.hpp> 
0022 
0023 /* An alias to mpl::vector used to hide MPL from the user.
0024  * indexed_by contains the index specifiers for instantiation
0025  * of a multi_index_container.
0026  */
0027 
0028 /* This user_definable macro limits the number of elements of an index list;
0029  * useful for shortening resulting symbol names (MSVC++ 6.0, for instance,
0030  * has problems coping with very long symbol names.)
0031  */
0032 
0033 #if !defined(BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE)
0034 #define BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE
0035 #endif
0036 
0037 #if BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE<BOOST_MPL_LIMIT_VECTOR_SIZE
0038 #define BOOST_MULTI_INDEX_INDEXED_BY_SIZE \
0039   BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE
0040 #else
0041 #define BOOST_MULTI_INDEX_INDEXED_BY_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE
0042 #endif
0043 
0044 #define BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM(z,n,var) \
0045   typename BOOST_PP_CAT(var,n) BOOST_PP_EXPR_IF(n,=mpl::na)
0046 
0047 namespace boost{
0048 
0049 namespace multi_index{
0050 
0051 template<
0052   BOOST_PP_ENUM(
0053     BOOST_MULTI_INDEX_INDEXED_BY_SIZE,
0054     BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM,T)
0055 >
0056 struct indexed_by:
0057   mpl::vector<BOOST_PP_ENUM_PARAMS(BOOST_MULTI_INDEX_INDEXED_BY_SIZE,T)>
0058 {
0059 };
0060 
0061 } /* namespace multi_index */
0062 
0063 } /* namespace boost */
0064 
0065 #undef BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM
0066 #undef BOOST_MULTI_INDEX_INDEXED_BY_SIZE
0067 
0068 #endif