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

Private GIT Repository
60fd28b723a92900ed63d2bb7a2033bb177c3141
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / detail / is_xxx.hpp
1 // Copyright David Abrahams 2005. Distributed under the Boost\r
2 // Software License, Version 1.0. (See accompanying\r
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
4 #ifndef BOOST_DETAIL_IS_XXX_DWA20051011_HPP\r
5 # define BOOST_DETAIL_IS_XXX_DWA20051011_HPP\r
6 \r
7 # include <boost/config.hpp>\r
8 # include <boost/mpl/bool.hpp>\r
9 # include <boost/preprocessor/enum_params.hpp>\r
10 \r
11 # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)\r
12 # include <boost/type_traits/is_reference.hpp>\r
13 # include <boost/type_traits/add_reference.hpp>\r
14 \r
15 #  define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs)          \\r
16 template <class X_>                                                     \\r
17 struct is_##name                                                        \\r
18 {                                                                       \\r
19     typedef char yes;                                                   \\r
20     typedef char (&no)[2];                                              \\r
21                                                                         \\r
22     static typename add_reference<X_>::type dummy;                      \\r
23                                                                         \\r
24     struct helpers                                                      \\r
25     {                                                                   \\r
26         template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class U) >          \\r
27         static yes test(                                                \\r
28            qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, U) >&, int  \\r
29         );                                                              \\r
30                                                                         \\r
31         template <class U>                                              \\r
32         static no test(U&, ...);                                        \\r
33     };                                                                  \\r
34                                                                         \\r
35     BOOST_STATIC_CONSTANT(                                              \\r
36         bool, value                                                     \\r
37         = !is_reference<X_>::value                                      \\r
38         & (sizeof(helpers::test(dummy, 0)) == sizeof(yes)));            \\r
39                                                                         \\r
40     typedef mpl::bool_<value> type;                                     \\r
41 };\r
42 \r
43 # else\r
44 \r
45 #  define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs)  \\r
46 template <class T>                                              \\r
47 struct is_##name : mpl::false_                                  \\r
48 {                                                               \\r
49 };                                                              \\r
50                                                                 \\r
51 template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class T) >          \\r
52 struct is_##name<                                               \\r
53    qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) >        \\r
54 >                                                               \\r
55    : mpl::true_                                                 \\r
56 {                                                               \\r
57 };\r
58 \r
59 # endif\r
60 \r
61 #endif // BOOST_DETAIL_IS_XXX_DWA20051011_HPP\r