1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
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
10 #include <boost/fusion/support/config.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 #include <boost/type_traits/is_convertible.hpp>
17 #include <boost/type_traits/is_same.hpp>
19 namespace boost { namespace fusion
22 struct non_fusion_tag;
23 struct boost_tuple_tag; // boost::tuples::tuple tag
24 struct boost_array_tag; // boost::array tag
25 struct mpl_sequence_tag; // mpl sequence tag
26 struct std_pair_tag; // std::pair tag
31 struct is_sequence_impl
33 template <typename Sequence>
35 : is_convertible<Sequence, fusion::detail::from_sequence_convertible_type>
40 struct is_sequence_impl<non_fusion_tag>
43 struct apply : mpl::false_ {};
47 struct is_sequence_impl<boost_tuple_tag>;
50 struct is_sequence_impl<boost_array_tag>;
53 struct is_sequence_impl<mpl_sequence_tag>;
56 struct is_sequence_impl<std_pair_tag>;
64 (bool)extension::is_sequence_impl<
65 typename fusion::detail::tag_of<T>::type
66 >::template apply<T>::type::value
70 template <typename Sequence, typename Enable = void>
71 struct is_native_fusion_sequence
72 : is_convertible<Sequence, fusion::detail::from_sequence_convertible_type>