1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/boost/multi_index/indexed_by.hpp Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,72 @@
1.4 +/* Copyright 2003-2005 Joaquín M López Muñoz.
1.5 + * Distributed under the Boost Software License, Version 1.0.
1.6 + * (See accompanying file LICENSE_1_0.txt or copy at
1.7 + * http://www.boost.org/LICENSE_1_0.txt)
1.8 + *
1.9 + * See http://www.boost.org/libs/multi_index for library home page.
1.10 + */
1.11 +
1.12 +#ifndef BOOST_MULTI_INDEX_INDEXED_BY_HPP
1.13 +#define BOOST_MULTI_INDEX_INDEXED_BY_HPP
1.14 +
1.15 +#if defined(_MSC_VER)&&(_MSC_VER>=1200)
1.16 +#pragma once
1.17 +#endif
1.18 +
1.19 +#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
1.20 +#include <boost/mpl/vector.hpp>
1.21 +#include <boost/preprocessor/cat.hpp>
1.22 +#include <boost/preprocessor/control/expr_if.hpp>
1.23 +#include <boost/preprocessor/repetition/enum.hpp>
1.24 +#include <boost/preprocessor/repetition/enum_params.hpp>
1.25 +
1.26 +/* An alias to mpl::vector used to hide MPL from the user.
1.27 + * indexed_by contains the index specifiers for instantiation
1.28 + * of a multi_index_container.
1.29 + */
1.30 +
1.31 +/* This user_definable macro limits the number of elements of an index list;
1.32 + * useful for shortening resulting symbol names (MSVC++ 6.0, for instance,
1.33 + * has problems coping with very long symbol names.)
1.34 + */
1.35 +
1.36 +#if !defined(BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE)
1.37 +#if defined(BOOST_MSVC)&&(BOOST_MSVC<1300)
1.38 +#define BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE 5
1.39 +#else
1.40 +#define BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE
1.41 +#endif
1.42 +#endif
1.43 +
1.44 +#if BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE<BOOST_MPL_LIMIT_VECTOR_SIZE
1.45 +#define BOOST_MULTI_INDEX_INDEXED_BY_SIZE \
1.46 + BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE
1.47 +#else
1.48 +#define BOOST_MULTI_INDEX_INDEXED_BY_SIZE BOOST_MPL_LIMIT_VECTOR_SIZE
1.49 +#endif
1.50 +
1.51 +#define BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM(z,n,var) \
1.52 + typename BOOST_PP_CAT(var,n) BOOST_PP_EXPR_IF(n,=mpl::na)
1.53 +
1.54 +namespace boost{
1.55 +
1.56 +namespace multi_index{
1.57 +
1.58 +template<
1.59 + BOOST_PP_ENUM(
1.60 + BOOST_MULTI_INDEX_INDEXED_BY_SIZE,
1.61 + BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM,T)
1.62 +>
1.63 +struct indexed_by:
1.64 + mpl::vector<BOOST_PP_ENUM_PARAMS(BOOST_MULTI_INDEX_INDEXED_BY_SIZE,T)>
1.65 +{
1.66 +};
1.67 +
1.68 +} /* namespace multi_index */
1.69 +
1.70 +} /* namespace boost */
1.71 +
1.72 +#undef BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM
1.73 +#undef BOOST_MULTI_INDEX_INDEXED_BY_SIZE
1.74 +
1.75 +#endif