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

Private GIT Repository
838c87c0034dcda54e6bf564f49a7a265e1dcd1d
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / mpl / aux_ / msvc_is_class.hpp
1 \r
2 #ifndef BOOST_MPL_AUX_MSVC_IS_CLASS_HPP_INCLUDED\r
3 #define BOOST_MPL_AUX_MSVC_IS_CLASS_HPP_INCLUDED\r
4 \r
5 // Copyright Aleksey Gurtovoy 2002-2004\r
6 //\r
7 // Distributed under the Boost Software License, Version 1.0. \r
8 // (See accompanying file LICENSE_1_0.txt or copy at \r
9 // http://www.boost.org/LICENSE_1_0.txt)\r
10 //\r
11 // See http://www.boost.org/libs/mpl for documentation.\r
12 \r
13 // $Id: msvc_is_class.hpp 49267 2008-10-11 06:19:02Z agurtovoy $\r
14 // $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $\r
15 // $Revision: 49267 $\r
16 \r
17 #include <boost/mpl/if.hpp>\r
18 #include <boost/mpl/bool.hpp>\r
19 #include <boost/mpl/aux_/type_wrapper.hpp>\r
20 #include <boost/mpl/aux_/yes_no.hpp>\r
21 \r
22 #include <boost/type_traits/is_reference.hpp>\r
23 \r
24 namespace boost { namespace mpl { namespace aux {\r
25 \r
26 template< typename T > struct is_class_helper\r
27 {\r
28     typedef int (T::* type)();\r
29 };\r
30 \r
31 // MSVC 6.x-specific lightweight 'is_class' implementation; \r
32 // Distinguishing feature: does not instantiate the type being tested.\r
33 template< typename T >\r
34 struct msvc_is_class_impl\r
35 {\r
36     template< typename U>\r
37     static yes_tag  test(type_wrapper<U>*, /*typename*/ is_class_helper<U>::type = 0);\r
38     static no_tag   test(void const volatile*, ...);\r
39 \r
40     enum { value = sizeof(test((type_wrapper<T>*)0)) == sizeof(yes_tag) };\r
41     typedef bool_<value> type;\r
42 };\r
43 \r
44 // agurt, 17/sep/04: have to check for 'is_reference' upfront to avoid ICEs in\r
45 // complex metaprograms\r
46 template< typename T >\r
47 struct msvc_is_class\r
48     : if_<\r
49           is_reference<T>\r
50         , false_\r
51         , msvc_is_class_impl<T>\r
52         >::type\r
53 {\r
54 };\r
55 \r
56 }}}\r
57 \r
58 #endif // BOOST_MPL_AUX_MSVC_IS_CLASS_HPP_INCLUDED\r