From 976288ac50d7d1de43fb209cb2005b6d648dc73a Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Tue, 5 Aug 2014 18:05:12 +0900 Subject: [PATCH] add types::tuple_cat --- sprout/type/operation.hpp | 1 + sprout/type/operation/tuple_cat.hpp | 62 +++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 sprout/type/operation/tuple_cat.hpp diff --git a/sprout/type/operation.hpp b/sprout/type/operation.hpp index ccc7c5d8..369826d8 100644 --- a/sprout/type/operation.hpp +++ b/sprout/type/operation.hpp @@ -9,6 +9,7 @@ #define SPROUT_TYPE_OPERATION_HPP #include +#include #include #include #include diff --git a/sprout/type/operation/tuple_cat.hpp b/sprout/type/operation/tuple_cat.hpp new file mode 100644 index 00000000..8818af5a --- /dev/null +++ b/sprout/type/operation/tuple_cat.hpp @@ -0,0 +1,62 @@ +/*============================================================================= + Copyright (c) 2011-2014 Bolero MURAKAMI + https://github.com/bolero-MURAKAMI/Sprout + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ +#ifndef SPROUT_TYPE_OPERATION_TUPLE_CAT_HPP +#define SPROUT_TYPE_OPERATION_TUPLE_CAT_HPP + +#include +#include +#include +#include +#include +#include + +namespace sprout { + namespace types { + // + // tuple_cat + // + namespace detail { + template + struct tuple_cat_impl; + template + struct tuple_cat_impl, sprout::index_tuple > + : public sprout::types::joint_types< + typename sprout::types::detail::tuple_cat_impl< + sprout::types::type_tuple::type...>, + typename sprout::index_range<0, sizeof...(LIndexes) / 2>::type, + typename sprout::index_range::type + >::type + >::template apply< + typename sprout::types::detail::tuple_cat_impl< + sprout::types::type_tuple::type...>, + typename sprout::index_range<0, sizeof...(RIndexes) / 2>::type, + typename sprout::index_range::type + >::type + > + {}; + template + struct tuple_cat_impl, sprout::index_tuple<0> > + : public sprout::types::tuple_element<0, Tuples> + {}; + template + struct tuple_cat_impl, sprout::index_tuple<> > + : public sprout::identity > + {}; + } // namespace detail + template + struct tuple_cat + : public sprout::types::detail::tuple_cat_impl< + sprout::types::type_tuple, + typename sprout::index_range<0, sizeof...(Tuples) / 2>::type, + typename sprout::index_range::type + > + {}; + } // namespace types +} // namespace sprout + +#endif // #ifndef SPROUT_TYPE_OPERATION_TUPLE_CAT_HPP