]> git.donarmstrong.com Git - rsem.git/blob - boost/fusion/support/is_sequence.hpp
d57cecb4101dc5ca7c69fa7769b1f5d6d7171fd4
[rsem.git] / boost / fusion / support / is_sequence.hpp
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/type_traits/is_base_of.hpp>
11 #include <boost/fusion/support/sequence_base.hpp>
12 #include <boost/fusion/support/tag_of.hpp>
13 #include <boost/mpl/is_sequence.hpp>
14 #include <boost/mpl/or.hpp>
15 #include <boost/mpl/bool.hpp>
16
17 namespace boost { namespace fusion
18 {
19     // Special tags:
20     struct non_fusion_tag;
21     struct boost_tuple_tag; // boost::tuples::tuple tag
22     struct boost_array_tag; // boost::array tag
23     struct mpl_sequence_tag; // mpl sequence tag
24     struct std_pair_tag; // std::pair tag
25
26     namespace extension
27     {
28         template <typename T>
29         struct is_sequence_impl
30         {
31             template <typename Sequence>
32             struct apply : is_base_of<sequence_root, Sequence> {};
33         };
34
35         template <>
36         struct is_sequence_impl<non_fusion_tag>
37         {
38             template <typename T>
39             struct apply : mpl::false_ {};
40         };
41
42         template <>
43         struct is_sequence_impl<boost_tuple_tag>;
44
45         template <>
46         struct is_sequence_impl<boost_array_tag>;
47
48         template <>
49         struct is_sequence_impl<mpl_sequence_tag>;
50
51         template <>
52         struct is_sequence_impl<std_pair_tag>;
53     }
54
55     namespace traits
56     {
57         template <typename T>
58         struct is_sequence
59           : extension::is_sequence_impl<
60                 typename fusion::detail::tag_of<T>::type
61             >::template apply<T>
62         {};
63     }
64 }}
65
66 #endif