Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:57:30

0001 
0002 #ifndef BOOST_MPL_IS_SEQUENCE_HPP_INCLUDED
0003 #define BOOST_MPL_IS_SEQUENCE_HPP_INCLUDED
0004 
0005 // Copyright Aleksey Gurtovoy 2002-2004
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. 
0008 // (See accompanying file LICENSE_1_0.txt or copy at 
0009 // http://www.boost.org/LICENSE_1_0.txt)
0010 //
0011 // See http://www.boost.org/libs/mpl for documentation.
0012 
0013 // $Id$
0014 // $Date$
0015 // $Revision$
0016 
0017 #include <boost/mpl/not.hpp>
0018 #include <boost/mpl/and.hpp>
0019 #include <boost/mpl/begin_end.hpp>
0020 #include <boost/mpl/if.hpp>
0021 #include <boost/mpl/bool.hpp>
0022 #include <boost/mpl/sequence_tag_fwd.hpp>
0023 #include <boost/mpl/identity.hpp>
0024 #include <boost/mpl/void.hpp>
0025 #include <boost/mpl/aux_/has_tag.hpp>
0026 #include <boost/mpl/aux_/has_begin.hpp>
0027 #include <boost/mpl/aux_/na_spec.hpp>
0028 #include <boost/mpl/aux_/lambda_support.hpp>
0029 #include <boost/mpl/aux_/config/eti.hpp>
0030 #include <boost/mpl/aux_/config/msvc.hpp>
0031 #include <boost/mpl/aux_/config/workaround.hpp>
0032 #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
0033 #   include <boost/mpl/aux_/msvc_is_class.hpp>
0034 #elif BOOST_WORKAROUND(BOOST_MSVC, == 1300)
0035 #   include <boost/type_traits/is_class.hpp>
0036 #endif
0037 
0038 #include <boost/type_traits/is_same.hpp>
0039 
0040 namespace boost { namespace mpl {
0041 
0042 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
0043 
0044 namespace aux {
0045 
0046 // agurt, 11/jun/03: 
0047 // MSVC 6.5/7.0 fails if 'has_begin' is instantiated on a class type that has a
0048 // 'begin' member that doesn't name a type; e.g. 'has_begin< std::vector<int> >'
0049 // would fail; requiring 'T' to have _both_ 'tag' and 'begin' members workarounds
0050 // the issue for most real-world cases
0051 template< typename T > struct is_sequence_impl
0052     : and_<
0053           identity< aux::has_tag<T> >
0054         , identity< aux::has_begin<T> >
0055         >
0056 {
0057 };
0058 
0059 } // namespace aux
0060         
0061 template<
0062       typename BOOST_MPL_AUX_NA_PARAM(T)
0063     >
0064 struct is_sequence
0065     : if_<
0066 #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
0067           aux::msvc_is_class<T> 
0068 #else
0069           boost::is_class<T> 
0070 #endif
0071         , aux::is_sequence_impl<T>
0072         , bool_<false>
0073         >::type
0074 {
0075     BOOST_MPL_AUX_LAMBDA_SUPPORT(1, is_sequence, (T))
0076 };
0077 
0078 #elif defined(BOOST_MPL_CFG_NO_HAS_XXX)
0079 
0080 template<
0081       typename BOOST_MPL_AUX_NA_PARAM(T)
0082     >
0083 struct is_sequence
0084     : bool_<false>
0085 {
0086 };
0087 
0088 #else
0089 
0090 template<
0091       typename BOOST_MPL_AUX_NA_PARAM(T)
0092     >
0093 struct is_sequence
0094     : not_< is_same< typename begin<T>::type, void_ > >
0095 {
0096     BOOST_MPL_AUX_LAMBDA_SUPPORT(1, is_sequence, (T))
0097 };
0098 
0099 #endif // BOOST_MSVC
0100 
0101 #if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
0102 template<> struct is_sequence<int>
0103     : bool_<false>
0104 {
0105 };
0106 #endif
0107 
0108 BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, is_sequence)
0109 
0110 }}
0111 
0112 #endif // BOOST_MPL_IS_SEQUENCE_HPP_INCLUDED