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

Private GIT Repository
e2f12cae3c99c5d1681f14d99e18ff53d85930bb
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / mpl / is_sequence.hpp
1 \r
2 #ifndef BOOST_MPL_IS_SEQUENCE_HPP_INCLUDED\r
3 #define BOOST_MPL_IS_SEQUENCE_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: is_sequence.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/not.hpp>\r
18 #include <boost/mpl/and.hpp>\r
19 #include <boost/mpl/begin_end.hpp>\r
20 #include <boost/mpl/if.hpp>\r
21 #include <boost/mpl/bool.hpp>\r
22 #include <boost/mpl/sequence_tag_fwd.hpp>\r
23 #include <boost/mpl/identity.hpp>\r
24 #include <boost/mpl/void.hpp>\r
25 #include <boost/mpl/aux_/has_tag.hpp>\r
26 #include <boost/mpl/aux_/has_begin.hpp>\r
27 #include <boost/mpl/aux_/na_spec.hpp>\r
28 #include <boost/mpl/aux_/lambda_support.hpp>\r
29 #include <boost/mpl/aux_/config/eti.hpp>\r
30 #include <boost/mpl/aux_/config/msvc.hpp>\r
31 #include <boost/mpl/aux_/config/workaround.hpp>\r
32 #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)\r
33 #   include <boost/mpl/aux_/msvc_is_class.hpp>\r
34 #elif BOOST_WORKAROUND(BOOST_MSVC, == 1300)\r
35 #   include <boost/type_traits/is_class.hpp>\r
36 #endif\r
37 \r
38 #include <boost/type_traits/is_same.hpp>\r
39 \r
40 namespace boost { namespace mpl {\r
41 \r
42 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)\r
43 \r
44 namespace aux {\r
45 \r
46 // agurt, 11/jun/03: \r
47 // MSVC 6.5/7.0 fails if 'has_begin' is instantiated on a class type that has a\r
48 // 'begin' member that doesn't name a type; e.g. 'has_begin< std::vector<int> >'\r
49 // would fail; requiring 'T' to have _both_ 'tag' and 'begin' members workarounds\r
50 // the issue for most real-world cases\r
51 template< typename T > struct is_sequence_impl\r
52     : and_<\r
53           identity< aux::has_tag<T> >\r
54         , identity< aux::has_begin<T> >\r
55         >\r
56 {\r
57 };\r
58 \r
59 } // namespace aux\r
60         \r
61 template<\r
62       typename BOOST_MPL_AUX_NA_PARAM(T)\r
63     >\r
64 struct is_sequence\r
65     : if_<\r
66 #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)\r
67           aux::msvc_is_class<T> \r
68 #else\r
69           boost::is_class<T> \r
70 #endif\r
71         , aux::is_sequence_impl<T>\r
72         , bool_<false>\r
73         >::type\r
74 {\r
75     BOOST_MPL_AUX_LAMBDA_SUPPORT(1, is_sequence, (T))\r
76 };\r
77 \r
78 #elif defined(BOOST_MPL_CFG_NO_HAS_XXX)\r
79 \r
80 template<\r
81       typename BOOST_MPL_AUX_NA_PARAM(T)\r
82     >\r
83 struct is_sequence\r
84     : bool_<false>\r
85 {\r
86 };\r
87 \r
88 #else\r
89 \r
90 template<\r
91       typename BOOST_MPL_AUX_NA_PARAM(T)\r
92     >\r
93 struct is_sequence\r
94     : not_< is_same< typename begin<T>::type, void_ > >\r
95 {\r
96     BOOST_MPL_AUX_LAMBDA_SUPPORT(1, is_sequence, (T))\r
97 };\r
98 \r
99 #endif // BOOST_MSVC\r
100 \r
101 #if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)\r
102 template<> struct is_sequence<int>\r
103     : bool_<false>\r
104 {\r
105 };\r
106 #endif\r
107 \r
108 BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, is_sequence)\r
109 \r
110 }}\r
111 \r
112 #endif // BOOST_MPL_IS_SEQUENCE_HPP_INCLUDED\r