2 #ifndef BOOST_MPL_MAP_AUX_ITEM_HPP_INCLUDED
\r
3 #define BOOST_MPL_MAP_AUX_ITEM_HPP_INCLUDED
\r
5 // Copyright Aleksey Gurtovoy 2003-2004
\r
6 // Copyright David Abrahams 2003-2004
\r
8 // Distributed under the Boost Software License, Version 1.0.
\r
9 // (See accompanying file LICENSE_1_0.txt or copy at
\r
10 // http://www.boost.org/LICENSE_1_0.txt)
\r
12 // See http://www.boost.org/libs/mpl for documentation.
\r
14 // $Id: item.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
\r
15 // $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
\r
16 // $Revision: 49267 $
\r
18 #include <boost/mpl/void.hpp>
\r
19 #include <boost/mpl/pair.hpp>
\r
20 #include <boost/mpl/long.hpp>
\r
21 #include <boost/mpl/next.hpp>
\r
22 #include <boost/mpl/prior.hpp>
\r
23 #include <boost/mpl/map/aux_/map0.hpp>
\r
24 #include <boost/mpl/aux_/order_impl.hpp>
\r
25 #include <boost/mpl/aux_/yes_no.hpp>
\r
26 #include <boost/mpl/aux_/type_wrapper.hpp>
\r
27 #include <boost/mpl/aux_/config/arrays.hpp>
\r
28 #include <boost/mpl/aux_/config/typeof.hpp>
\r
29 #include <boost/mpl/aux_/config/ctps.hpp>
\r
32 namespace boost { namespace mpl {
\r
34 #if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
\r
36 template< typename Key, typename T, typename Base >
\r
41 typedef pair<Key,T> item;
\r
44 typedef typename next< typename Base::size >::type size;
\r
45 typedef typename next< typename Base::order >::type order;
\r
47 #if defined(BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES)
\r
48 typedef typename aux::weighted_tag<BOOST_MPL_AUX_MSVC_VALUE_WKND(order)::value>::type order_tag_;
\r
50 typedef char (&order_tag_)[BOOST_MPL_AUX_MSVC_VALUE_WKND(order)::value];
\r
53 BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper<T>, VALUE_BY_KEY, m_item, aux::type_wrapper<Key>* );
\r
54 BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper<item>, ITEM_BY_ORDER, m_item, order* );
\r
55 BOOST_MPL_AUX_MAP_OVERLOAD( order_tag_, ORDER_BY_KEY, m_item, aux::type_wrapper<Key>* );
\r
59 template< typename Key, typename Base >
\r
66 typedef typename prior< typename Base::size >::type size;
\r
67 typedef typename x_order_impl<Base,Key>::type key_order_;
\r
69 BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper<void_>, VALUE_BY_KEY, m_mask, aux::type_wrapper<Key>* );
\r
70 BOOST_MPL_AUX_MAP_OVERLOAD( aux::type_wrapper<void_>, ITEM_BY_ORDER, m_mask, key_order_* );
\r
73 #else // BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES
\r
76 # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
\r
78 template< long n, typename Key, typename T, typename Base >
\r
86 template< typename Key, typename T, typename Base >
\r
90 template< long n, typename Key, typename T, typename Base >
\r
92 : m_item_impl<n>::result_<Key,T,Base>
\r
100 template< typename Key, typename T, typename Base >
\r
106 typedef m_item_ type;
\r
108 typedef typename next< typename Base::size >::type size;
\r
109 typedef typename next< typename Base::order >::type order;
\r
111 #if defined(BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES)
\r
112 typedef typename aux::weighted_tag<BOOST_MPL_AUX_MSVC_VALUE_WKND(order)::value>::type order_tag_;
\r
114 typedef char (&order_tag_)[BOOST_MPL_AUX_MSVC_VALUE_WKND(order)::value];
\r
117 BOOST_MPL_AUX_MAP_OVERLOAD( order_tag_, ORDER_BY_KEY, m_item_, aux::type_wrapper<Key>* );
\r
120 template< typename Key, typename Base >
\r
124 typedef void_ key_;
\r
127 typedef typename prior< typename Base::size >::type size;
\r
128 typedef typename x_order_impl<Base,Key>::type key_order_;
\r
130 BOOST_MPL_AUX_MAP_OVERLOAD( aux::no_tag, ORDER_BY_KEY, m_mask, aux::type_wrapper<Key>* );
\r
131 BOOST_MPL_AUX_MAP_OVERLOAD( aux::yes_tag, IS_MASKED, m_mask, key_order_* );
\r
134 #endif // BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES
\r
138 #endif // BOOST_MPL_MAP_AUX_ITEM_HPP_INCLUDED
\r