File indexing completed on 2025-01-31 10:02:38
0001
0002
0003
0004
0005
0006
0007 #if !defined(BOOST_SPIRIT_X3_TUPLE_TRAITS_JANUARY_2012_1132PM)
0008 #define BOOST_SPIRIT_X3_TUPLE_TRAITS_JANUARY_2012_1132PM
0009
0010 #include <boost/fusion/include/is_sequence.hpp>
0011 #include <boost/fusion/include/is_view.hpp>
0012 #include <boost/fusion/include/size.hpp>
0013 #include <boost/mpl/bool.hpp>
0014 #include <boost/mpl/and.hpp>
0015
0016 namespace boost { namespace spirit { namespace x3 { namespace traits
0017 {
0018 template <typename A, typename B>
0019 struct has_same_size
0020 : mpl::bool_<(
0021 fusion::result_of::size<A>::value ==
0022 fusion::result_of::size<B>::value
0023 )>
0024 {};
0025
0026 template <typename T, std::size_t N>
0027 struct has_size
0028 : mpl::bool_<(fusion::result_of::size<T>::value == N)>
0029 {};
0030
0031 template <typename A, typename B>
0032 struct is_same_size_sequence
0033 : mpl::and_<
0034 fusion::traits::is_sequence<A>
0035 , fusion::traits::is_sequence<B>
0036 , has_same_size<A, B>
0037 >
0038 {};
0039
0040 template <typename Seq>
0041 struct is_size_one_sequence
0042 : mpl::and_<
0043 fusion::traits::is_sequence<Seq>
0044 , has_size<Seq, 1>
0045 >
0046 {};
0047
0048 template <typename View>
0049 struct is_size_one_view
0050 : mpl::and_<
0051 fusion::traits::is_view<View>
0052 , has_size<View, 1>
0053 >
0054 {};
0055 }}}}
0056
0057 #endif