1/*=============================================================================
2 Copyright (c) 2001-2014 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(BOOST_SPIRIT_X3_TUPLE_TRAITS_JANUARY_2012_1132PM)
8#define BOOST_SPIRIT_X3_TUPLE_TRAITS_JANUARY_2012_1132PM
9
10#include <boost/fusion/include/is_sequence.hpp>
11#include <boost/fusion/include/is_view.hpp>
12#include <boost/fusion/include/size.hpp>
13#include <boost/mpl/bool.hpp>
14#include <boost/mpl/and.hpp>
15
16namespace boost { namespace spirit { namespace x3 { namespace traits
17{
18 template <typename A, typename B>
19 struct has_same_size
20 : mpl::bool_<(
21 fusion::result_of::size<A>::value ==
22 fusion::result_of::size<B>::value
23 )>
24 {};
25
26 template <typename T, std::size_t N>
27 struct has_size
28 : mpl::bool_<(fusion::result_of::size<T>::value == N)>
29 {};
30
31 template <typename A, typename B>
32 struct is_same_size_sequence
33 : mpl::and_<
34 fusion::traits::is_sequence<A>
35 , fusion::traits::is_sequence<B>
36 , has_same_size<A, B>
37 >
38 {};
39
40 template <typename Seq>
41 struct is_size_one_sequence
42 : mpl::and_<
43 fusion::traits::is_sequence<Seq>
44 , has_size<Seq, 1>
45 >
46 {};
47
48 template <typename View>
49 struct is_size_one_view
50 : mpl::and_<
51 fusion::traits::is_view<View>
52 , has_size<View, 1>
53 >
54 {};
55}}}}
56
57#endif
58

source code of boost/libs/spirit/include/boost/spirit/home/x3/support/traits/tuple_traits.hpp