Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:41:38

0001 
0002 #ifndef BOOST_MPL_AUX_ORDER_IMPL_HPP_INCLUDED
0003 #define BOOST_MPL_AUX_ORDER_IMPL_HPP_INCLUDED
0004 
0005 // Copyright Aleksey Gurtovoy 2003-2004
0006 // Copyright David Abrahams 2003-2004
0007 //
0008 // Distributed under the Boost Software License, Version 1.0. 
0009 // (See accompanying file LICENSE_1_0.txt or copy at 
0010 // http://www.boost.org/LICENSE_1_0.txt)
0011 //
0012 // See http://www.boost.org/libs/mpl for documentation.
0013 
0014 // $Id$
0015 // $Date$
0016 // $Revision$
0017 
0018 #include <boost/mpl/order_fwd.hpp>
0019 #include <boost/mpl/if.hpp>
0020 #include <boost/mpl/long.hpp>
0021 #include <boost/mpl/has_key.hpp>
0022 #include <boost/mpl/aux_/overload_names.hpp>
0023 #include <boost/mpl/aux_/static_cast.hpp>
0024 #include <boost/mpl/aux_/type_wrapper.hpp>
0025 #include <boost/mpl/aux_/traits_lambda_spec.hpp>
0026 #include <boost/mpl/aux_/config/msvc.hpp>
0027 #include <boost/mpl/aux_/config/static_constant.hpp>
0028 #include <boost/mpl/aux_/config/workaround.hpp>
0029 
0030 namespace boost { namespace mpl {
0031 
0032 // default implementation; requires 'Seq' to provide corresponding overloads 
0033 // of BOOST_MPL_AUX_OVERLOAD_ORDER_BY_KEY
0034 
0035 template< typename Seq, typename Key > struct x_order_impl
0036 #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \
0037     || BOOST_WORKAROUND(__EDG_VERSION__, <= 245)
0038 {
0039     BOOST_STATIC_CONSTANT(long, value = 
0040           sizeof( BOOST_MPL_AUX_OVERLOAD_CALL_ORDER_BY_KEY(
0041               Seq
0042             , BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper<Key>*, 0)
0043             ) )
0044         );
0045 
0046     typedef long_<value> type;
0047 
0048 #else // ISO98 C++
0049     : long_< 
0050           sizeof( BOOST_MPL_AUX_OVERLOAD_CALL_ORDER_BY_KEY(
0051               Seq
0052             , BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper<Key>*, 0)
0053             ) )
0054         >
0055 {
0056 #endif
0057 };
0058 
0059 template< typename Tag >
0060 struct order_impl
0061 {
0062     template< typename Seq, typename Key > struct apply
0063         : if_<
0064               typename has_key_impl<Tag>::template apply<Seq,Key>
0065             , x_order_impl<Seq,Key>
0066             , void_
0067             >::type
0068     {
0069     };
0070 };
0071 
0072 BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(2,order_impl)
0073 
0074 }}
0075 
0076 #endif // BOOST_MPL_AUX_ORDER_IMPL_HPP_INCLUDED