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