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

Private GIT Repository
b2f6268cc40c1fa9d456a7f2a0537847ae8004cc
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / mpl / aux_ / has_rebind.hpp
1 \r
2 #ifndef BOOST_MPL_AUX_HAS_REBIND_HPP_INCLUDED\r
3 #define BOOST_MPL_AUX_HAS_REBIND_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: has_rebind.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/aux_/config/msvc.hpp>\r
18 #include <boost/mpl/aux_/config/intel.hpp>\r
19 #include <boost/mpl/aux_/config/workaround.hpp>\r
20 \r
21 #if BOOST_WORKAROUND(__EDG_VERSION__, <= 244) && !defined(BOOST_INTEL_CXX_VERSION)\r
22 #   include <boost/mpl/has_xxx.hpp>\r
23 #elif BOOST_WORKAROUND(BOOST_MSVC, < 1300)\r
24 #   include <boost/mpl/has_xxx.hpp>\r
25 #   include <boost/mpl/if.hpp>\r
26 #   include <boost/mpl/bool.hpp>\r
27 #   include <boost/mpl/aux_/msvc_is_class.hpp>\r
28 #elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610))\r
29 #   include <boost/mpl/if.hpp>\r
30 #   include <boost/mpl/bool.hpp>\r
31 #   include <boost/mpl/aux_/yes_no.hpp>\r
32 #   include <boost/mpl/aux_/config/static_constant.hpp>\r
33 #   include <boost/type_traits/is_class.hpp>\r
34 #else\r
35 #   include <boost/mpl/aux_/type_wrapper.hpp>\r
36 #   include <boost/mpl/aux_/yes_no.hpp>\r
37 #   include <boost/mpl/aux_/config/static_constant.hpp>\r
38 #endif\r
39 \r
40 namespace boost { namespace mpl { namespace aux {\r
41 \r
42 #if BOOST_WORKAROUND(__EDG_VERSION__, <= 244) && !defined(BOOST_INTEL_CXX_VERSION)\r
43 \r
44 BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_rebind, rebind, false)\r
45 \r
46 #elif BOOST_WORKAROUND(BOOST_MSVC, < 1300)\r
47 \r
48 BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_rebind_impl, rebind, false)\r
49 \r
50 template< typename T >\r
51 struct has_rebind\r
52     : if_< \r
53           msvc_is_class<T>\r
54         , has_rebind_impl<T>\r
55         , bool_<false>\r
56         >::type\r
57 {\r
58 };\r
59 \r
60 #else // the rest\r
61 \r
62 template< typename T > struct has_rebind_tag {};\r
63 no_tag operator|(has_rebind_tag<int>, void const volatile*);\r
64 \r
65 #   if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610))\r
66 template< typename T >\r
67 struct has_rebind\r
68 {\r
69     static has_rebind_tag<T>* get();\r
70     BOOST_STATIC_CONSTANT(bool, value = \r
71           sizeof(has_rebind_tag<int>() | get()) == sizeof(yes_tag)\r
72         );\r
73 };\r
74 #   else // __BORLANDC__\r
75 template< typename T >\r
76 struct has_rebind_impl\r
77 {\r
78     static T* get();\r
79     BOOST_STATIC_CONSTANT(bool, value = \r
80           sizeof(has_rebind_tag<int>() | get()) == sizeof(yes_tag)\r
81         );\r
82 };\r
83 \r
84 template< typename T >\r
85 struct has_rebind\r
86     : if_< \r
87           is_class<T>\r
88         , has_rebind_impl<T>\r
89         , bool_<false>\r
90         >::type\r
91 {\r
92 };\r
93 #   endif // __BORLANDC__\r
94 \r
95 #endif\r
96 \r
97 }}}\r
98 \r
99 #endif // BOOST_MPL_AUX_HAS_REBIND_HPP_INCLUDED\r