2 #ifndef BOOST_MPL_IS_SEQUENCE_HPP_INCLUDED
\r
3 #define BOOST_MPL_IS_SEQUENCE_HPP_INCLUDED
\r
5 // Copyright Aleksey Gurtovoy 2002-2004
\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
11 // See http://www.boost.org/libs/mpl for documentation.
\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
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
38 #include <boost/type_traits/is_same.hpp>
\r
40 namespace boost { namespace mpl {
\r
42 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
\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
53 identity< aux::has_tag<T> >
\r
54 , identity< aux::has_begin<T> >
\r
62 typename BOOST_MPL_AUX_NA_PARAM(T)
\r
66 #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
\r
67 aux::msvc_is_class<T>
\r
71 , aux::is_sequence_impl<T>
\r
75 BOOST_MPL_AUX_LAMBDA_SUPPORT(1, is_sequence, (T))
\r
78 #elif defined(BOOST_MPL_CFG_NO_HAS_XXX)
\r
81 typename BOOST_MPL_AUX_NA_PARAM(T)
\r
91 typename BOOST_MPL_AUX_NA_PARAM(T)
\r
94 : not_< is_same< typename begin<T>::type, void_ > >
\r
96 BOOST_MPL_AUX_LAMBDA_SUPPORT(1, is_sequence, (T))
\r
99 #endif // BOOST_MSVC
\r
101 #if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
\r
102 template<> struct is_sequence<int>
\r
108 BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, is_sequence)
\r
112 #endif // BOOST_MPL_IS_SEQUENCE_HPP_INCLUDED
\r