]> AND Private Git Repository - canny.git/blob - stc/exp/ml_stc_linux_make_v1.0/include/boost/mpl/aux_/order_impl.hpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
968f293d734e176dce4b2f1df73b8512a28dd933
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / mpl / aux_ / order_impl.hpp
1 \r
2 #ifndef BOOST_MPL_AUX_ORDER_IMPL_HPP_INCLUDED\r
3 #define BOOST_MPL_AUX_ORDER_IMPL_HPP_INCLUDED\r
4 \r
5 // Copyright Aleksey Gurtovoy 2003-2004\r
6 // Copyright David Abrahams 2003-2004\r
7 //\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
11 //\r
12 // See http://www.boost.org/libs/mpl for documentation.\r
13 \r
14 // $Id: order_impl.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
17 \r
18 #include <boost/mpl/order_fwd.hpp>\r
19 #include <boost/mpl/if.hpp>\r
20 #include <boost/mpl/long.hpp>\r
21 #include <boost/mpl/has_key.hpp>\r
22 #include <boost/mpl/aux_/overload_names.hpp>\r
23 #include <boost/mpl/aux_/static_cast.hpp>\r
24 #include <boost/mpl/aux_/type_wrapper.hpp>\r
25 #include <boost/mpl/aux_/traits_lambda_spec.hpp>\r
26 #include <boost/mpl/aux_/config/msvc.hpp>\r
27 #include <boost/mpl/aux_/config/static_constant.hpp>\r
28 #include <boost/mpl/aux_/config/workaround.hpp>\r
29 \r
30 namespace boost { namespace mpl {\r
31 \r
32 // default implementation; requires 'Seq' to provide corresponding overloads \r
33 // of BOOST_MPL_AUX_OVERLOAD_ORDER_BY_KEY\r
34 \r
35 template< typename Seq, typename Key > struct x_order_impl\r
36 #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \\r
37     || BOOST_WORKAROUND(__EDG_VERSION__, <= 245)\r
38 {\r
39     BOOST_STATIC_CONSTANT(long, value = \r
40           sizeof( BOOST_MPL_AUX_OVERLOAD_CALL_ORDER_BY_KEY(\r
41               Seq\r
42             , BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper<Key>*, 0)\r
43             ) )\r
44         );\r
45 \r
46     typedef long_<value> type;\r
47 \r
48 #else // ISO98 C++\r
49     : long_< \r
50           sizeof( BOOST_MPL_AUX_OVERLOAD_CALL_ORDER_BY_KEY(\r
51               Seq\r
52             , BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper<Key>*, 0)\r
53             ) )\r
54         >\r
55 {\r
56 #endif\r
57 };\r
58 \r
59 template< typename Tag >\r
60 struct order_impl\r
61 {\r
62     template< typename Seq, typename Key > struct apply\r
63         : if_<\r
64               typename has_key_impl<Tag>::template apply<Seq,Key>\r
65             , x_order_impl<Seq,Key>\r
66             , void_\r
67             >::type\r
68     {\r
69     };\r
70 };\r
71 \r
72 BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(2,order_impl)\r
73 \r
74 }}\r
75 \r
76 #endif // BOOST_MPL_AUX_ORDER_IMPL_HPP_INCLUDED\r