epoc32/include/stdapis/boost/mpl/is_sequence.hpp
branchSymbian2
changeset 2 2fe1408b6811
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/boost/mpl/is_sequence.hpp	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,112 @@
     1.4 +
     1.5 +#ifndef BOOST_MPL_IS_SEQUENCE_HPP_INCLUDED
     1.6 +#define BOOST_MPL_IS_SEQUENCE_HPP_INCLUDED
     1.7 +
     1.8 +// Copyright Aleksey Gurtovoy 2002-2004
     1.9 +//
    1.10 +// Distributed under the Boost Software License, Version 1.0. 
    1.11 +// (See accompanying file LICENSE_1_0.txt or copy at 
    1.12 +// http://www.boost.org/LICENSE_1_0.txt)
    1.13 +//
    1.14 +// See http://www.boost.org/libs/mpl for documentation.
    1.15 +
    1.16 +// $Source: /cvsroot/boost/boost/boost/mpl/is_sequence.hpp,v $
    1.17 +// $Date: 2005/08/25 16:27:21 $
    1.18 +// $Revision: 1.9 $
    1.19 +
    1.20 +#include <boost/mpl/not.hpp>
    1.21 +#include <boost/mpl/and.hpp>
    1.22 +#include <boost/mpl/begin_end.hpp>
    1.23 +#include <boost/mpl/if.hpp>
    1.24 +#include <boost/mpl/bool.hpp>
    1.25 +#include <boost/mpl/sequence_tag_fwd.hpp>
    1.26 +#include <boost/mpl/identity.hpp>
    1.27 +#include <boost/mpl/void.hpp>
    1.28 +#include <boost/mpl/aux_/has_tag.hpp>
    1.29 +#include <boost/mpl/aux_/has_begin.hpp>
    1.30 +#include <boost/mpl/aux_/na_spec.hpp>
    1.31 +#include <boost/mpl/aux_/lambda_support.hpp>
    1.32 +#include <boost/mpl/aux_/config/eti.hpp>
    1.33 +#include <boost/mpl/aux_/config/msvc.hpp>
    1.34 +#include <boost/mpl/aux_/config/workaround.hpp>
    1.35 +#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
    1.36 +#   include <boost/mpl/aux_/msvc_is_class.hpp>
    1.37 +#elif BOOST_WORKAROUND(BOOST_MSVC, == 1300)
    1.38 +#   include <boost/type_traits/is_class.hpp>
    1.39 +#endif
    1.40 +
    1.41 +#include <boost/type_traits/is_same.hpp>
    1.42 +
    1.43 +namespace boost { namespace mpl {
    1.44 +
    1.45 +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
    1.46 +
    1.47 +namespace aux {
    1.48 +
    1.49 +// agurt, 11/jun/03: 
    1.50 +// MSVC 6.5/7.0 fails if 'has_begin' is instantiated on a class type that has a
    1.51 +// 'begin' member that doesn't name a type; e.g. 'has_begin< std::vector<int> >'
    1.52 +// would fail; requiring 'T' to have _both_ 'tag' and 'begin' members workarounds
    1.53 +// the issue for most real-world cases
    1.54 +template< typename T > struct is_sequence_impl
    1.55 +    : and_<
    1.56 +          identity< aux::has_tag<T> >
    1.57 +        , identity< aux::has_begin<T> >
    1.58 +        >
    1.59 +{
    1.60 +};
    1.61 +
    1.62 +} // namespace aux
    1.63 +        
    1.64 +template<
    1.65 +      typename BOOST_MPL_AUX_NA_PARAM(T)
    1.66 +    >
    1.67 +struct is_sequence
    1.68 +    : if_<
    1.69 +#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
    1.70 +          aux::msvc_is_class<T> 
    1.71 +#else
    1.72 +          boost::is_class<T> 
    1.73 +#endif
    1.74 +        , aux::is_sequence_impl<T>
    1.75 +        , bool_<false>
    1.76 +        >::type
    1.77 +{
    1.78 +    BOOST_MPL_AUX_LAMBDA_SUPPORT(1, is_sequence, (T))
    1.79 +};
    1.80 +
    1.81 +#elif defined(BOOST_MPL_CFG_NO_HAS_XXX)
    1.82 +
    1.83 +template<
    1.84 +      typename BOOST_MPL_AUX_NA_PARAM(T)
    1.85 +    >
    1.86 +struct is_sequence
    1.87 +    : bool_<false>
    1.88 +{
    1.89 +};
    1.90 +
    1.91 +#else
    1.92 +
    1.93 +template<
    1.94 +      typename BOOST_MPL_AUX_NA_PARAM(T)
    1.95 +    >
    1.96 +struct is_sequence
    1.97 +    : not_< is_same< typename begin<T>::type, void_ > >
    1.98 +{
    1.99 +    BOOST_MPL_AUX_LAMBDA_SUPPORT(1, is_sequence, (T))
   1.100 +};
   1.101 +
   1.102 +#endif // BOOST_MSVC
   1.103 +
   1.104 +#if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
   1.105 +template<> struct is_sequence<int>
   1.106 +    : bool_<false>
   1.107 +{
   1.108 +};
   1.109 +#endif
   1.110 +
   1.111 +BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, is_sequence)
   1.112 +
   1.113 +}}
   1.114 +
   1.115 +#endif // BOOST_MPL_IS_SEQUENCE_HPP_INCLUDED