From b2daf0262c846007834bb2db107f4062af2b4d38 Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Sat, 5 Apr 2014 19:33:32 +0900 Subject: [PATCH] add nested_array --- sprout/array.hpp | 1 + sprout/array/nested_array.hpp | 46 +++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 sprout/array/nested_array.hpp diff --git a/sprout/array.hpp b/sprout/array.hpp index 2f5b203d..ce024e7e 100644 --- a/sprout/array.hpp +++ b/sprout/array.hpp @@ -15,5 +15,6 @@ #include #include #include +#include #endif // #ifndef SPROUT_ARRAY_HPP diff --git a/sprout/array/nested_array.hpp b/sprout/array/nested_array.hpp new file mode 100644 index 00000000..61ecd43b --- /dev/null +++ b/sprout/array/nested_array.hpp @@ -0,0 +1,46 @@ +/*============================================================================= + 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_ARRAY_NESTED_ARRAY_HPP +#define SPROUT_ARRAY_NESTED_ARRAY_HPP + +#include +#include +#include +#include + +namespace sprout { + namespace detail { + template + struct nested_array_t_impl; + template + struct nested_array_t_impl + : public sprout::identity > + {}; + template + struct nested_array_t_impl + : public sprout::detail::nested_array_t_impl, Ms...> + {}; + } // namespace detail + // + // nested_array_t + // + template + struct nested_array_t + : public sprout::detail::nested_array_t_impl + {}; + +#if SPROUT_USE_TEMPLATE_ALIASES + // + // nested_array + // + template + using nested_array = typename sprout::nested_array_t::type; +#endif // #if SPROUT_USE_TEMPLATE_ALIASES +} // namespace sprout + +#endif // #ifndef SPROUT_ARRAY_NESTED_ARRAY_HPP