Chris@16
|
1 /*=============================================================================
|
Chris@16
|
2 Copyright (c) 2001-2011 Joel de Guzman
|
Chris@16
|
3
|
Chris@16
|
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6 ==============================================================================*/
|
Chris@16
|
7 #if !defined(FUSION_IS_VIEW_03202006_0015)
|
Chris@16
|
8 #define FUSION_IS_VIEW_03202006_0015
|
Chris@16
|
9
|
Chris@101
|
10 #include <boost/fusion/support/config.hpp>
|
Chris@16
|
11 #include <boost/mpl/bool.hpp>
|
Chris@16
|
12 #include <boost/fusion/support/detail/is_view.hpp>
|
Chris@16
|
13 #include <boost/fusion/support/tag_of.hpp>
|
Chris@16
|
14
|
Chris@16
|
15 namespace boost { namespace fusion
|
Chris@16
|
16 {
|
Chris@16
|
17 // Special tags:
|
Chris@16
|
18 struct sequence_facade_tag;
|
Chris@16
|
19 struct boost_tuple_tag; // boost::tuples::tuple tag
|
Chris@16
|
20 struct boost_array_tag; // boost::array tag
|
Chris@16
|
21 struct mpl_sequence_tag; // mpl sequence tag
|
Chris@16
|
22 struct std_pair_tag; // std::pair tag
|
Chris@16
|
23
|
Chris@16
|
24 namespace extension
|
Chris@16
|
25 {
|
Chris@16
|
26 template<typename Tag>
|
Chris@16
|
27 struct is_view_impl
|
Chris@16
|
28 {
|
Chris@16
|
29 template <typename T>
|
Chris@16
|
30 struct apply
|
Chris@16
|
31 : detail::fusion_is_view<T>
|
Chris@16
|
32 {};
|
Chris@16
|
33 };
|
Chris@16
|
34
|
Chris@16
|
35 template <>
|
Chris@16
|
36 struct is_view_impl<sequence_facade_tag>
|
Chris@16
|
37 {
|
Chris@16
|
38 template <typename Sequence>
|
Chris@16
|
39 struct apply : Sequence::is_view {};
|
Chris@16
|
40 };
|
Chris@16
|
41
|
Chris@16
|
42 template <>
|
Chris@16
|
43 struct is_view_impl<boost_tuple_tag>;
|
Chris@16
|
44
|
Chris@16
|
45 template <>
|
Chris@16
|
46 struct is_view_impl<boost_array_tag>;
|
Chris@16
|
47
|
Chris@16
|
48 template <>
|
Chris@16
|
49 struct is_view_impl<mpl_sequence_tag>;
|
Chris@16
|
50
|
Chris@16
|
51 template <>
|
Chris@16
|
52 struct is_view_impl<std_pair_tag>;
|
Chris@16
|
53 }
|
Chris@16
|
54
|
Chris@16
|
55 namespace traits
|
Chris@16
|
56 {
|
Chris@16
|
57 template <typename T>
|
Chris@16
|
58 struct is_view :
|
Chris@16
|
59 mpl::bool_<
|
Chris@16
|
60 (bool)extension::is_view_impl<typename fusion::detail::tag_of<T>::type>::
|
Chris@16
|
61 template apply<T>::type::value
|
Chris@16
|
62 >
|
Chris@16
|
63 {};
|
Chris@16
|
64 }
|
Chris@16
|
65 }}
|
Chris@16
|
66
|
Chris@16
|
67 #endif
|