diff --git a/example/csv/main.cpp b/example/csv/main.cpp index ef2dedf5..d061fd6e 100644 --- a/example/csv/main.cpp +++ b/example/csv/main.cpp @@ -15,9 +15,6 @@ #include #include -template -using subbed_array = sprout::sub_array >; - template struct csv_parser_settings { public: @@ -45,10 +42,10 @@ public: }; template -constexpr subbed_array, L> +constexpr sprout::array_sub_t, L> parse_csv(String const& src, csv_parser_settings settings = csv_parser_settings()) { typedef typename String::value_type value_type; - subbed_array, L> result = {}; + sprout::array_sub_t, L> result = {}; result.window(0, 1); result.back().window(0, 0); auto delimiters = sprout::make_string(settings.delimiter(), value_type('\r'), value_type('\n')); diff --git a/sprout/sub_array.hpp b/sprout/sub_array.hpp index ba97c4cf..8e838b19 100644 --- a/sprout/sub_array.hpp +++ b/sprout/sub_array.hpp @@ -18,5 +18,6 @@ #include #include #include +#include #endif // #ifndef SPROUT_SUB_ARRAY_HPP diff --git a/sprout/sub_array/array_sub.hpp b/sprout/sub_array/array_sub.hpp new file mode 100644 index 00000000..017b6b1c --- /dev/null +++ b/sprout/sub_array/array_sub.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2011-2016 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_SUB_ARRAY_ARRAY_SUB_HPP +#define SPROUT_SUB_ARRAY_ARRAY_SUB_HPP + +#include +#include +#include +#include +#include + +namespace sprout { + // + // array_sub + // + template + struct array_sub + : public sprout::identity > > + {}; + +#if SPROUT_USE_TEMPLATE_ALIASES + template + using array_sub_t = typename sprout::array_sub::type; +#endif // #if SPROUT_USE_TEMPLATE_ALIASES +} // namespace sprout + +#endif // #ifndef SPROUT_SUB_ARRAY_ARRAY_SUB_HPP