PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/fusion/support/is_sequence.hpp

http://hadesmem.googlecode.com/
C++ Header | 74 lines | 56 code | 11 blank | 7 comment | 0 complexity | dc1859eac5658e95645a10ef20617f50 MD5 | raw file
 1/*=============================================================================
 2    Copyright (c) 2001-2006 Joel de Guzman
 3
 4    Distributed under the Boost Software License, Version 1.0. (See accompanying
 5    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 6==============================================================================*/
 7#if !defined(FUSION_IS_SEQUENCE_05052005_1002)
 8#define FUSION_IS_SEQUENCE_05052005_1002
 9
10#include <boost/fusion/support/sequence_base.hpp>
11#include <boost/fusion/support/tag_of.hpp>
12#include <boost/mpl/is_sequence.hpp>
13#include <boost/mpl/or.hpp>
14#include <boost/mpl/bool.hpp>
15#include <boost/type_traits/is_convertible.hpp>
16#include <boost/type_traits/is_same.hpp>
17
18namespace boost { namespace fusion
19{
20    // Special tags:
21    struct non_fusion_tag;
22    struct boost_tuple_tag; // boost::tuples::tuple tag
23    struct boost_array_tag; // boost::array tag
24    struct mpl_sequence_tag; // mpl sequence tag
25    struct std_pair_tag; // std::pair tag
26
27    namespace extension
28    {
29        template <typename T>
30        struct is_sequence_impl
31        {
32            template <typename Sequence>
33            struct apply
34              : is_convertible<Sequence, detail::from_sequence_convertible_type>
35            {};
36        };
37
38        template <>
39        struct is_sequence_impl<non_fusion_tag>
40        {
41            template <typename T>
42            struct apply : mpl::false_ {};
43        };
44
45        template <>
46        struct is_sequence_impl<boost_tuple_tag>;
47
48        template <>
49        struct is_sequence_impl<boost_array_tag>;
50
51        template <>
52        struct is_sequence_impl<mpl_sequence_tag>;
53
54        template <>
55        struct is_sequence_impl<std_pair_tag>;
56    }
57
58    namespace traits
59    {
60        template <typename T>
61        struct is_sequence
62          : extension::is_sequence_impl<
63                typename fusion::detail::tag_of<T>::type
64            >::template apply<T>
65        {};
66
67        template <typename Sequence, typename Enable = void>
68        struct is_native_fusion_sequence
69          : is_convertible<Sequence, detail::from_sequence_convertible_type>
70        {};
71    }
72}}
73
74#endif