2 #ifndef BOOST_MPL_AUX_ORDER_IMPL_HPP_INCLUDED
3 #define BOOST_MPL_AUX_ORDER_IMPL_HPP_INCLUDED
5 // Copyright Aleksey Gurtovoy 2003-2004
6 // Copyright David Abrahams 2003-2004
8 // Distributed under the Boost Software License, Version 1.0.
9 // (See accompanying file LICENSE_1_0.txt or copy at
10 // http://www.boost.org/LICENSE_1_0.txt)
12 // See http://www.boost.org/libs/mpl for documentation.
18 #include <boost/mpl/order_fwd.hpp>
19 #include <boost/mpl/if.hpp>
20 #include <boost/mpl/long.hpp>
21 #include <boost/mpl/has_key.hpp>
22 #include <boost/mpl/aux_/overload_names.hpp>
23 #include <boost/mpl/aux_/static_cast.hpp>
24 #include <boost/mpl/aux_/type_wrapper.hpp>
25 #include <boost/mpl/aux_/traits_lambda_spec.hpp>
26 #include <boost/mpl/aux_/config/msvc.hpp>
27 #include <boost/mpl/aux_/config/static_constant.hpp>
28 #include <boost/mpl/aux_/config/workaround.hpp>
30 namespace boost { namespace mpl {
32 // default implementation; requires 'Seq' to provide corresponding overloads
33 // of BOOST_MPL_AUX_OVERLOAD_ORDER_BY_KEY
35 template< typename Seq, typename Key > struct x_order_impl
36 #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \
37 || BOOST_WORKAROUND(__EDG_VERSION__, <= 245)
39 BOOST_STATIC_CONSTANT(long, value =
40 sizeof( BOOST_MPL_AUX_OVERLOAD_CALL_ORDER_BY_KEY(
42 , BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper<Key>*, 0)
46 typedef long_<value> type;
50 sizeof( BOOST_MPL_AUX_OVERLOAD_CALL_ORDER_BY_KEY(
52 , BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper<Key>*, 0)
59 template< typename Tag >
62 template< typename Seq, typename Key > struct apply
64 typename has_key_impl<Tag>::template apply<Seq,Key>
65 , x_order_impl<Seq,Key>
72 BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(2,order_impl)
76 #endif // BOOST_MPL_AUX_ORDER_IMPL_HPP_INCLUDED