diff --git a/libs/weed/example/__TIME__.cpp b/libs/weed/example/__TIME__.cpp index 2074e511..d287d440 100644 --- a/libs/weed/example/__TIME__.cpp +++ b/libs/weed/example/__TIME__.cpp @@ -1,68 +1,68 @@ -// -// Sprout C++ Library -// -// Copyright (c) 2012 -// bolero-MURAKAMI : http://d.hatena.ne.jp/boleros/ -// osyo-manga : http://d.hatena.ne.jp/osyo-manga/ -// -// Readme: -// https://github.com/osyo-manga/cpp-half/blob/master/README -// -// License: -// Boost Software License - Version 1.0 -// -// -#include -#include -#include -#include - -// -// __TIME__ Parser -// -int -main(){ - namespace w = sprout::weed; - - // - // __TIME__ to Sprout.String - // - static constexpr auto time = sprout::to_string(__TIME__); -// static constexpr auto time = sprout::to_string("23:22:45"); - - - // - // parse __TIME__ - // - constexpr auto expr = w::int_ >> ':' >> w::int_ >> ':' >> w::int_; - static constexpr auto result = w::parse(time.begin(), time.end(), parser); - static_assert(result.success(), "failed parse"); - - - // - // get result - // - static constexpr sprout::array result_attr = result.attr(); - static constexpr auto hour = result_attr[0]; - static constexpr auto minute = result_attr[1]; - static constexpr auto second = result_attr[2]; - -// static_assert(hour == 23, ""); -// static_assert(minute == 22, ""); -// static_assert(second == 45, ""); - - std::cout << hour << std::endl; - std::cout << minute << std::endl; - std::cout << second << std::endl; - - - // - // compile time output - // - namespace m = boost::mpl; - typedef m::print>::type hour_; - typedef m::print>::type minute_; - typedef m::print>::type second_; - - return 0; -} +// +// Sprout C++ Library +// +// Copyright (c) 2012 +// bolero-MURAKAMI : http://d.hatena.ne.jp/boleros/ +// osyo-manga : http://d.hatena.ne.jp/osyo-manga/ +// +// Readme: +// https://github.com/osyo-manga/cpp-half/blob/master/README +// +// License: +// Boost Software License - Version 1.0 +// +// +#include +#include +#include +#include + +// +// __TIME__ Parser +// +int +main(){ + namespace w = sprout::weed; + + // + // __TIME__ to Sprout.String + // + static constexpr auto time = sprout::to_string(__TIME__); +// static constexpr auto time = sprout::to_string("23:22:45"); + + + // + // parse __TIME__ + // + constexpr auto expr = w::int_ >> ':' >> w::int_ >> ':' >> w::int_; + static constexpr auto result = w::parse(time.begin(), time.end(), parser); + static_assert(result.success(), "failed parse"); + + + // + // get result + // + static constexpr sprout::array result_attr = result.attr(); + static constexpr auto hour = result_attr[0]; + static constexpr auto minute = result_attr[1]; + static constexpr auto second = result_attr[2]; + +// static_assert(hour == 23, ""); +// static_assert(minute == 22, ""); +// static_assert(second == 45, ""); + + std::cout << hour << std::endl; + std::cout << minute << std::endl; + std::cout << second << std::endl; + + + // + // compile time output + // + namespace m = boost::mpl; + typedef m::print>::type hour_; + typedef m::print>::type minute_; + typedef m::print>::type second_; + + return 0; +} diff --git a/sprout/algorithm/fixed/copy.hpp b/sprout/algorithm/fixed/copy.hpp index 6db2d0bd..f0620593 100644 --- a/sprout/algorithm/fixed/copy.hpp +++ b/sprout/algorithm/fixed/copy.hpp @@ -47,7 +47,7 @@ namespace sprout { first, last, result, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), sprout::internal_begin_offset(result), sprout::size(result), NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) diff --git a/sprout/algorithm/fixed/copy_backward.hpp b/sprout/algorithm/fixed/copy_backward.hpp index 2108f6c7..3de530c1 100644 --- a/sprout/algorithm/fixed/copy_backward.hpp +++ b/sprout/algorithm/fixed/copy_backward.hpp @@ -48,7 +48,7 @@ namespace sprout { first, last, result, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), sprout::internal_end_offset(result), sprout::size(result), NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) diff --git a/sprout/algorithm/fixed/fill.hpp b/sprout/algorithm/fixed/fill.hpp index 001462d6..cc071a0d 100644 --- a/sprout/algorithm/fixed/fill.hpp +++ b/sprout/algorithm/fixed/fill.hpp @@ -42,7 +42,7 @@ namespace sprout { return sprout::fixed::detail::fill_impl( cont, value, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), sprout::internal_begin_offset(cont), sprout::size(cont) ); diff --git a/sprout/algorithm/fixed/fill_n.hpp b/sprout/algorithm/fixed/fill_n.hpp index ba20b8be..f8dbe015 100644 --- a/sprout/algorithm/fixed/fill_n.hpp +++ b/sprout/algorithm/fixed/fill_n.hpp @@ -23,7 +23,7 @@ namespace sprout { return sprout::fixed::detail::fill_impl( cont, value, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), sprout::internal_begin_offset(cont), n ); diff --git a/sprout/algorithm/fixed/replace_copy.hpp b/sprout/algorithm/fixed/replace_copy.hpp index e537d108..3fe9cc8d 100644 --- a/sprout/algorithm/fixed/replace_copy.hpp +++ b/sprout/algorithm/fixed/replace_copy.hpp @@ -54,7 +54,7 @@ namespace sprout { result, old_value, new_value, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), sprout::internal_begin_offset(result), sprout::size(result), NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) diff --git a/sprout/algorithm/fixed/replace_copy_if.hpp b/sprout/algorithm/fixed/replace_copy_if.hpp index 1f4aca13..549ad139 100644 --- a/sprout/algorithm/fixed/replace_copy_if.hpp +++ b/sprout/algorithm/fixed/replace_copy_if.hpp @@ -53,7 +53,7 @@ namespace sprout { result, pred, new_value, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), sprout::internal_begin_offset(result), sprout::size(result), NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) diff --git a/sprout/algorithm/fixed/reverse_copy.hpp b/sprout/algorithm/fixed/reverse_copy.hpp index 0b8202d4..8a2bc0d3 100644 --- a/sprout/algorithm/fixed/reverse_copy.hpp +++ b/sprout/algorithm/fixed/reverse_copy.hpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT @@ -47,7 +47,7 @@ namespace sprout { first, last, result, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), sprout::internal_begin_offset(result), sprout::size(result), NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) diff --git a/sprout/algorithm/fixed/rotate_copy.hpp b/sprout/algorithm/fixed/rotate_copy.hpp index 034c7201..f62821cd 100644 --- a/sprout/algorithm/fixed/rotate_copy.hpp +++ b/sprout/algorithm/fixed/rotate_copy.hpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT @@ -53,7 +53,7 @@ namespace sprout { middle, last, result, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), sprout::internal_begin_offset(result), sprout::size(result), NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) diff --git a/sprout/algorithm/fixed/shuffle.hpp b/sprout/algorithm/fixed/shuffle.hpp index e3926f24..13f29726 100644 --- a/sprout/algorithm/fixed/shuffle.hpp +++ b/sprout/algorithm/fixed/shuffle.hpp @@ -103,7 +103,7 @@ namespace sprout { { return sprout::fixed::detail::shuffle_impl( cont, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), sprout::forward(g), sprout::internal_begin_offset(cont), sprout::size(cont) diff --git a/sprout/algorithm/fixed/shuffle_result.hpp b/sprout/algorithm/fixed/shuffle_result.hpp index 5bda6e6e..c7163f17 100644 --- a/sprout/algorithm/fixed/shuffle_result.hpp +++ b/sprout/algorithm/fixed/shuffle_result.hpp @@ -140,7 +140,7 @@ namespace sprout { { return sprout::fixed::detail::shuffle_result_impl( cont, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), sprout::forward(g), sprout::internal_begin_offset(cont), sprout::size(cont) diff --git a/sprout/algorithm/fixed/swap_element_copy.hpp b/sprout/algorithm/fixed/swap_element_copy.hpp index 910daf73..e2ba019e 100644 --- a/sprout/algorithm/fixed/swap_element_copy.hpp +++ b/sprout/algorithm/fixed/swap_element_copy.hpp @@ -57,7 +57,7 @@ namespace sprout { result, pos1, pos2, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), sprout::internal_begin_offset(result), sprout::size(result), NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) diff --git a/sprout/algorithm/fixed/transform.hpp b/sprout/algorithm/fixed/transform.hpp index 13465e17..d3851f0d 100644 --- a/sprout/algorithm/fixed/transform.hpp +++ b/sprout/algorithm/fixed/transform.hpp @@ -50,7 +50,7 @@ namespace sprout { last, result, op, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), sprout::internal_begin_offset(result), sprout::size(result), NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) @@ -155,7 +155,7 @@ namespace sprout { first2, result, op, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), sprout::internal_begin_offset(result), sprout::size(result), NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1) diff --git a/sprout/array.hpp b/sprout/array.hpp index be485ef2..166bc950 100644 --- a/sprout/array.hpp +++ b/sprout/array.hpp @@ -258,7 +258,7 @@ namespace sprout { // template inline SPROUT_CONSTEXPR sprout::array to_array(T const (& arr)[N]) { - return sprout::detail::to_array_impl(arr, typename sprout::index_range<0, N>::type()); + return sprout::detail::to_array_impl(arr, sprout::index_range<0, N>::make()); } // diff --git a/sprout/breed/generate.hpp b/sprout/breed/generate.hpp index 8d9113b1..8a921356 100644 --- a/sprout/breed/generate.hpp +++ b/sprout/breed/generate.hpp @@ -55,7 +55,7 @@ namespace sprout { } public: static SPROUT_CONSTEXPR type call(src_type const& e) { - return call_impl(typename sprout::index_range<0, sizeof...(Args)>::type()); + return call_impl(sprout::index_range<0, sizeof...(Args)>::make()); } }; template @@ -74,7 +74,7 @@ namespace sprout { } public: static SPROUT_CONSTEXPR type call(src_type const& e) { - return call_impl(typename sprout::index_range<0, sizeof...(Args)>::type()); + return call_impl(sprout::index_range<0, sizeof...(Args)>::make()); } }; } // namespace detail diff --git a/sprout/breed/transform/pass_through.hpp b/sprout/breed/transform/pass_through.hpp index 3c4a032c..33bb62d1 100644 --- a/sprout/breed/transform/pass_through.hpp +++ b/sprout/breed/transform/pass_through.hpp @@ -74,7 +74,7 @@ namespace sprout { typename pass_through_impl::data_param d ) const { - return call_impl(e, s, d, typename sprout::index_range<0, Arity>::type()); + return call_impl(e, s, d, sprout::index_range<0, Arity>::make()); } }; template diff --git a/sprout/darkroom/pixels/generate.hpp b/sprout/darkroom/pixels/generate.hpp index 05519a17..d264a0f1 100644 --- a/sprout/darkroom/pixels/generate.hpp +++ b/sprout/darkroom/pixels/generate.hpp @@ -106,12 +106,12 @@ namespace sprout { width, height, depth_max, - typename sprout::index_range< + sprout::index_range< 0, sprout::container_traits< typename sprout::container_traits::value_type >::static_size - >::type() + >::make() )... ); } @@ -162,10 +162,10 @@ namespace sprout { width, height, depth_max, - typename sprout::index_range< + sprout::index_range< 0, sprout::container_traits::static_size - >::type() + >::make() ); } diff --git a/sprout/functional/bind/bind.hpp b/sprout/functional/bind/bind.hpp index 08d98e44..e7675d94 100644 --- a/sprout/functional/bind/bind.hpp +++ b/sprout/functional/bind/bind.hpp @@ -180,7 +180,7 @@ namespace sprout { SPROUT_CONSTEXPR auto operator()(CVArg& arg, sprout::tuples::tuple& tuple) const volatile -> decltype(arg(std::declval()...)) { - return call(arg, tuple, typename sprout::index_range<0, sizeof...(Args)>::type()); + return call(arg, tuple, sprout::index_range<0, sizeof...(Args)>::make()); } }; template diff --git a/sprout/numeric/dft/fixed/dft.hpp b/sprout/numeric/dft/fixed/dft.hpp index ae667357..44ede9fb 100644 --- a/sprout/numeric/dft/fixed/dft.hpp +++ b/sprout/numeric/dft/fixed/dft.hpp @@ -44,7 +44,7 @@ namespace sprout { first, last, result, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), sprout::internal_begin_offset(result), sprout::size(result), NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) diff --git a/sprout/numeric/dft/fixed/idft.hpp b/sprout/numeric/dft/fixed/idft.hpp index a5cc4933..67893689 100644 --- a/sprout/numeric/dft/fixed/idft.hpp +++ b/sprout/numeric/dft/fixed/idft.hpp @@ -44,7 +44,7 @@ namespace sprout { first, last, result, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), sprout::internal_begin_offset(result), sprout::size(result), NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) diff --git a/sprout/numeric/dft/fixed/spectrum.hpp b/sprout/numeric/dft/fixed/spectrum.hpp index 7a2324f9..a41254ba 100644 --- a/sprout/numeric/dft/fixed/spectrum.hpp +++ b/sprout/numeric/dft/fixed/spectrum.hpp @@ -53,7 +53,7 @@ namespace sprout { first, last, result, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), sprout::internal_begin_offset(result), sprout::size(result), NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) diff --git a/sprout/numeric/fft/fixed/bitrev_table.hpp b/sprout/numeric/fft/fixed/bitrev_table.hpp index c545de70..c8c1d138 100644 --- a/sprout/numeric/fft/fixed/bitrev_table.hpp +++ b/sprout/numeric/fft/fixed/bitrev_table.hpp @@ -47,7 +47,7 @@ namespace sprout { { return sprout::fixed::detail::bitrev_table_impl( cont, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), sprout::empty(cont) ? 0 : sprout::bit_length(sprout::size(cont) - 1) diff --git a/sprout/numeric/fixed/iota.hpp b/sprout/numeric/fixed/iota.hpp index 0b3f29eb..ffd2d60d 100644 --- a/sprout/numeric/fixed/iota.hpp +++ b/sprout/numeric/fixed/iota.hpp @@ -41,7 +41,7 @@ namespace sprout { { return sprout::fixed::detail::iota_impl( cont, - typename sprout::index_range<0, sprout::container_traits::static_size>::type(), + sprout::index_range<0, sprout::container_traits::static_size>::make(), value, sprout::internal_begin_offset(cont), sprout::size(cont) diff --git a/sprout/operation/fixed/append.hpp b/sprout/operation/fixed/append.hpp index 84b285b2..2ab86bb4 100644 --- a/sprout/operation/fixed/append.hpp +++ b/sprout/operation/fixed/append.hpp @@ -62,7 +62,7 @@ namespace sprout { { return sprout::fixed::detail::append_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), pos), sprout::size(input), input @@ -80,7 +80,7 @@ namespace sprout { { return sprout::fixed::detail::append_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos)), sprout::size(input), input diff --git a/sprout/operation/fixed/append_back.hpp b/sprout/operation/fixed/append_back.hpp index dc11edde..c4959638 100644 --- a/sprout/operation/fixed/append_back.hpp +++ b/sprout/operation/fixed/append_back.hpp @@ -31,7 +31,7 @@ namespace sprout { { return sprout::fixed::detail::append_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::internal_end_offset(cont), sprout::size(input), input diff --git a/sprout/operation/fixed/append_front.hpp b/sprout/operation/fixed/append_front.hpp index 471263c8..f5251fe3 100644 --- a/sprout/operation/fixed/append_front.hpp +++ b/sprout/operation/fixed/append_front.hpp @@ -31,7 +31,7 @@ namespace sprout { { return sprout::fixed::detail::append_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::internal_begin_offset(cont), sprout::size(input), input diff --git a/sprout/operation/fixed/erase.hpp b/sprout/operation/fixed/erase.hpp index 6b5ba538..b069bb7b 100644 --- a/sprout/operation/fixed/erase.hpp +++ b/sprout/operation/fixed/erase.hpp @@ -58,7 +58,7 @@ namespace sprout { { return sprout::fixed::detail::erase_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), pos) ); } @@ -73,7 +73,7 @@ namespace sprout { { return sprout::fixed::detail::erase_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos)) ); } diff --git a/sprout/operation/fixed/erase_n.hpp b/sprout/operation/fixed/erase_n.hpp index aa9d6dd7..241c3ebe 100644 --- a/sprout/operation/fixed/erase_n.hpp +++ b/sprout/operation/fixed/erase_n.hpp @@ -59,7 +59,7 @@ namespace sprout { { return sprout::fixed::detail::erase_n_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), pos) ); } @@ -74,7 +74,7 @@ namespace sprout { { return sprout::fixed::detail::erase_n_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos)) ); } diff --git a/sprout/operation/fixed/insert.hpp b/sprout/operation/fixed/insert.hpp index d2510dee..5e2eecbb 100644 --- a/sprout/operation/fixed/insert.hpp +++ b/sprout/operation/fixed/insert.hpp @@ -65,7 +65,7 @@ namespace sprout { { return sprout::fixed::detail::insert_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), pos), v, values... @@ -84,7 +84,7 @@ namespace sprout { { return sprout::fixed::detail::insert_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos)), v, values... diff --git a/sprout/operation/fixed/insert_n.hpp b/sprout/operation/fixed/insert_n.hpp index ccec4f66..f38fe47e 100644 --- a/sprout/operation/fixed/insert_n.hpp +++ b/sprout/operation/fixed/insert_n.hpp @@ -67,7 +67,7 @@ namespace sprout { { return sprout::fixed::detail::insert_n_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), pos), v, values... @@ -86,7 +86,7 @@ namespace sprout { { return sprout::fixed::detail::insert_n_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos)), v, values... diff --git a/sprout/operation/fixed/pop_back.hpp b/sprout/operation/fixed/pop_back.hpp index 16f27e29..f450ecea 100644 --- a/sprout/operation/fixed/pop_back.hpp +++ b/sprout/operation/fixed/pop_back.hpp @@ -30,7 +30,7 @@ namespace sprout { { return sprout::fixed::detail::erase_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::internal_end_offset(cont) - 1 ); } diff --git a/sprout/operation/fixed/pop_back_n.hpp b/sprout/operation/fixed/pop_back_n.hpp index f4bea30c..fc34e0ce 100644 --- a/sprout/operation/fixed/pop_back_n.hpp +++ b/sprout/operation/fixed/pop_back_n.hpp @@ -30,7 +30,7 @@ namespace sprout { { return sprout::fixed::detail::erase_n_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::internal_end_offset(cont) - N ); } diff --git a/sprout/operation/fixed/pop_front.hpp b/sprout/operation/fixed/pop_front.hpp index b313ef7e..66ecedb5 100644 --- a/sprout/operation/fixed/pop_front.hpp +++ b/sprout/operation/fixed/pop_front.hpp @@ -30,7 +30,7 @@ namespace sprout { { return sprout::fixed::detail::erase_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::internal_begin_offset(cont) ); } diff --git a/sprout/operation/fixed/pop_front_n.hpp b/sprout/operation/fixed/pop_front_n.hpp index 6d7ab78e..34419080 100644 --- a/sprout/operation/fixed/pop_front_n.hpp +++ b/sprout/operation/fixed/pop_front_n.hpp @@ -30,7 +30,7 @@ namespace sprout { { return sprout::fixed::detail::erase_n_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::internal_begin_offset(cont) ); } diff --git a/sprout/operation/fixed/push_back.hpp b/sprout/operation/fixed/push_back.hpp index 5d88a43d..c57b6ab5 100644 --- a/sprout/operation/fixed/push_back.hpp +++ b/sprout/operation/fixed/push_back.hpp @@ -32,7 +32,7 @@ namespace sprout { { return sprout::fixed::detail::insert_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::internal_end_offset(cont), v, values... diff --git a/sprout/operation/fixed/push_back_n.hpp b/sprout/operation/fixed/push_back_n.hpp index 23d1d1f2..a9660030 100644 --- a/sprout/operation/fixed/push_back_n.hpp +++ b/sprout/operation/fixed/push_back_n.hpp @@ -32,7 +32,7 @@ namespace sprout { { return sprout::fixed::detail::insert_n_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::internal_end_offset(cont), v, values... diff --git a/sprout/operation/fixed/push_front.hpp b/sprout/operation/fixed/push_front.hpp index 779b3b18..ce25c589 100644 --- a/sprout/operation/fixed/push_front.hpp +++ b/sprout/operation/fixed/push_front.hpp @@ -32,7 +32,7 @@ namespace sprout { { return sprout::fixed::detail::insert_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::internal_begin_offset(cont), v, values... diff --git a/sprout/operation/fixed/push_front_n.hpp b/sprout/operation/fixed/push_front_n.hpp index 44f0d435..ad7a8a3d 100644 --- a/sprout/operation/fixed/push_front_n.hpp +++ b/sprout/operation/fixed/push_front_n.hpp @@ -32,7 +32,7 @@ namespace sprout { { return sprout::fixed::detail::insert_n_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::internal_begin_offset(cont), v, values... diff --git a/sprout/operation/fixed/realign.hpp b/sprout/operation/fixed/realign.hpp index e6698377..cbfb22b4 100644 --- a/sprout/operation/fixed/realign.hpp +++ b/sprout/operation/fixed/realign.hpp @@ -48,7 +48,7 @@ namespace sprout { { return sprout::fixed::detail::realign_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::size(cont), v ); @@ -80,7 +80,7 @@ namespace sprout { { return sprout::fixed::detail::realign_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::size(cont) ); } diff --git a/sprout/operation/fixed/realign_to.hpp b/sprout/operation/fixed/realign_to.hpp index 2bc85174..1c83c7ff 100644 --- a/sprout/operation/fixed/realign_to.hpp +++ b/sprout/operation/fixed/realign_to.hpp @@ -32,7 +32,7 @@ namespace sprout { { return sprout::fixed::detail::realign_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::size(cont), v ); @@ -48,7 +48,7 @@ namespace sprout { { return sprout::fixed::detail::realign_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::size(cont) ); } diff --git a/sprout/operation/fixed/resize.hpp b/sprout/operation/fixed/resize.hpp index 01a3b14a..bfe3723b 100644 --- a/sprout/operation/fixed/resize.hpp +++ b/sprout/operation/fixed/resize.hpp @@ -53,7 +53,7 @@ namespace sprout { { return sprout::fixed::detail::resize_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::size(cont), v ); @@ -84,7 +84,7 @@ namespace sprout { ) { return sprout::fixed::detail::resize_impl::type>( - cont, typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + cont, sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::size(cont) ); } diff --git a/sprout/operation/fixed/resize_backward.hpp b/sprout/operation/fixed/resize_backward.hpp index 5cd6d622..6565aad7 100644 --- a/sprout/operation/fixed/resize_backward.hpp +++ b/sprout/operation/fixed/resize_backward.hpp @@ -50,7 +50,7 @@ namespace sprout { { return sprout::fixed::detail::resize_backward_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::size(cont), static_cast::difference_type>( sprout::container_traits::type>::static_size @@ -87,7 +87,7 @@ namespace sprout { { return sprout::fixed::detail::resize_backward_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), sprout::size(cont), static_cast::difference_type>( sprout::container_traits::type>::static_size diff --git a/sprout/operation/fixed/set.hpp b/sprout/operation/fixed/set.hpp index 30d9609e..e8c66b5e 100644 --- a/sprout/operation/fixed/set.hpp +++ b/sprout/operation/fixed/set.hpp @@ -52,7 +52,7 @@ namespace sprout { { return sprout::fixed::detail::set_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), pos), v ); @@ -69,7 +69,7 @@ namespace sprout { { return sprout::fixed::detail::set_impl::type>( cont, - typename sprout::index_range<0, sprout::container_traits::type>::static_size>::type(), + sprout::index_range<0, sprout::container_traits::type>::static_size>::make(), NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::next(sprout::begin(cont), pos)), v ); diff --git a/sprout/string/shrink.hpp b/sprout/string/shrink.hpp index 9a9770eb..9ee38bec 100644 --- a/sprout/string/shrink.hpp +++ b/sprout/string/shrink.hpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT @@ -12,14 +13,12 @@ namespace sprout { // // shrink_string // - template + template > class shrink_string { public: typedef sprout::basic_string string_type; private: typedef sprout::value_holder holder_type; - public: - typedef typename holder_type::param_type param_type; private: template static SPROUT_CONSTEXPR sprout::basic_string implicit_conversion_impl( @@ -35,9 +34,12 @@ namespace sprout { public: shrink_string(shrink_string const&) = default; shrink_string(shrink_string&&) = default; - explicit SPROUT_CONSTEXPR shrink_string(param_type p) - : holder_(p) + SPROUT_CONSTEXPR shrink_string(string_type const& s) + : holder_(s) {} + SPROUT_CONSTEXPR operator string_type const&() const { + return holder_.get(); + } template SPROUT_CONSTEXPR operator sprout::basic_string() const { return implicit_conversion_impl( diff --git a/sprout/string/string.hpp b/sprout/string/string.hpp index 265cc67f..5ecf31ec 100644 --- a/sprout/string/string.hpp +++ b/sprout/string/string.hpp @@ -112,7 +112,7 @@ namespace sprout { public: static SPROUT_CONSTEXPR basic_string from_c_str(value_type const* s, size_type n) { return !(N < n) - ? from_c_str_impl(s, n, typename sprout::index_range<0, N>::type()) + ? from_c_str_impl(s, n, sprout::index_range<0, N>::make()) : throw std::out_of_range("basic_string<>: index out of range") ; } @@ -357,7 +357,7 @@ namespace sprout { return implicit_conversion_impl( elems, len, - typename sprout::index_range<0, N2>::type() + sprout::index_range<0, N2>::make() ); } pointer c_array() SPROUT_NOEXCEPT { @@ -522,7 +522,7 @@ namespace sprout { } // namespace detail template inline SPROUT_CONSTEXPR sprout::basic_string to_string(T const(& arr)[N]) { - return sprout::detail::to_string_impl(arr, typename sprout::index_range<0, N - 1>::type()); + return sprout::detail::to_string_impl(arr, sprout::index_range<0, N - 1>::make()); } // diff --git a/sprout/sub_array.hpp b/sprout/sub_array.hpp index 78bd6b22..56bf2e35 100644 --- a/sprout/sub_array.hpp +++ b/sprout/sub_array.hpp @@ -205,7 +205,7 @@ namespace sprout { : impl_type( array_tag(), arr, - typename sprout::index_range<0, static_size>::type(), + sprout::index_range<0, static_size>::make(), first, last ) @@ -214,7 +214,7 @@ namespace sprout { : impl_type( array_tag(), arr, - typename sprout::index_range<0, static_size>::type(), + sprout::index_range<0, static_size>::make(), first, last ) @@ -223,7 +223,7 @@ namespace sprout { : impl_type( array_tag(), impl_type::template to_param(other.array_), - typename sprout::index_range<0, static_size>::type(), + sprout::index_range<0, static_size>::make(), NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(other.get_array()), first), NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(other.get_array()), last) ) @@ -232,7 +232,7 @@ namespace sprout { : impl_type( array_tag(), impl_type::template to_param(other.array_), - typename sprout::index_range<0, static_size>::type(), + sprout::index_range<0, static_size>::make(), first + other.first_, last + other.first_ ) diff --git a/sprout/tuple/algorithm/copy.hpp b/sprout/tuple/algorithm/copy.hpp index 10b2ba4a..a5f6de5f 100644 --- a/sprout/tuple/algorithm/copy.hpp +++ b/sprout/tuple/algorithm/copy.hpp @@ -47,8 +47,8 @@ namespace sprout { return sprout::tuples::detail::copy_impl::type>( t, input, - typename sprout::index_range::value, sprout::tuples::tuple_size::value>::type(), - typename sprout::index_range<0, sprout::tuples::tuple_size::value>::type() + sprout::index_range::value, sprout::tuples::tuple_size::value>::make(), + sprout::index_range<0, sprout::tuples::tuple_size::value>::make() ); } template @@ -64,7 +64,7 @@ namespace sprout { t, input, sprout::index_tuple<>(), - typename sprout::index_range<0, sprout::tuples::tuple_size::value>::type() + sprout::index_range<0, sprout::tuples::tuple_size::value>::make() ); } } // namespace detail diff --git a/sprout/tuple/operation/append_back.hpp b/sprout/tuple/operation/append_back.hpp index d5d447fc..4c700053 100644 --- a/sprout/tuple/operation/append_back.hpp +++ b/sprout/tuple/operation/append_back.hpp @@ -47,8 +47,8 @@ namespace sprout { return sprout::tuples::detail::append_back_impl::type>( t, input, - typename sprout::index_range<0, sprout::tuples::tuple_size::value>::type(), - typename sprout::index_range<0, sprout::tuples::tuple_size::value>::type() + sprout::index_range<0, sprout::tuples::tuple_size::value>::make(), + sprout::index_range<0, sprout::tuples::tuple_size::value>::make() ); } } // namespace tuples diff --git a/sprout/tuple/operation/append_front.hpp b/sprout/tuple/operation/append_front.hpp index f01db28c..11249f90 100644 --- a/sprout/tuple/operation/append_front.hpp +++ b/sprout/tuple/operation/append_front.hpp @@ -47,8 +47,8 @@ namespace sprout { return sprout::tuples::detail::append_front_impl::type>( t, input, - typename sprout::index_range<0, sprout::tuples::tuple_size::value>::type(), - typename sprout::index_range<0, sprout::tuples::tuple_size::value>::type() + sprout::index_range<0, sprout::tuples::tuple_size::value>::make(), + sprout::index_range<0, sprout::tuples::tuple_size::value>::make() ); } } // namespace tuples diff --git a/sprout/tuple/operation/push_back.hpp b/sprout/tuple/operation/push_back.hpp index 86f546a7..dc8f5383 100644 --- a/sprout/tuple/operation/push_back.hpp +++ b/sprout/tuple/operation/push_back.hpp @@ -46,7 +46,7 @@ namespace sprout { return sprout::tuples::detail::push_back_impl::type>( t, v, - typename sprout::index_range<0, sprout::tuples::tuple_size::value>::type() + sprout::index_range<0, sprout::tuples::tuple_size::value>::make() ); } } // namespace tuples diff --git a/sprout/tuple/operation/push_front.hpp b/sprout/tuple/operation/push_front.hpp index be1e28c7..6b7032bb 100644 --- a/sprout/tuple/operation/push_front.hpp +++ b/sprout/tuple/operation/push_front.hpp @@ -46,7 +46,7 @@ namespace sprout { return sprout::tuples::detail::push_front_impl::type>( t, v, - typename sprout::index_range<0, sprout::tuples::tuple_size::value>::type() + sprout::index_range<0, sprout::tuples::tuple_size::value>::make() ); } } // namespace tuples diff --git a/sprout/type/string/to_string_constant.hpp b/sprout/type/string/to_string_constant.hpp index 228f0a47..80791f60 100644 --- a/sprout/type/string/to_string_constant.hpp +++ b/sprout/type/string/to_string_constant.hpp @@ -53,7 +53,7 @@ namespace sprout { sprout::types::detail::str_length::value > to_string_constant() { return sprout::types::detail::to_string_constant_impl( - typename sprout::index_range<0, sprout::types::detail::str_length::value>::type() + sprout::index_range<0, sprout::types::detail::str_length::value>::make() ); } } // namespace types diff --git a/sprout/type_traits/inherit_if_xxx.hpp b/sprout/type_traits/inherit_if_xxx.hpp index d67078fb..fe414b01 100644 --- a/sprout/type_traits/inherit_if_xxx.hpp +++ b/sprout/type_traits/inherit_if_xxx.hpp @@ -48,10 +48,10 @@ typename std::enable_if::value>::type \ > { \ public: \ - SPROUT_STATIC_CONSTEXPR decltype(T::CONSTANT) ALIAS = T::CONSTANT; \ + SPROUT_STATIC_CONSTEXPR typename std::decay::type ALIAS = T::CONSTANT; \ }; \ template \ - SPROUT_CONSTEXPR decltype(T::CONSTANT) NAME< \ + SPROUT_CONSTEXPR typename std::decay::type NAME< \ T, \ typename std::enable_if::value>::type \ >::ALIAS diff --git a/sprout/variant/variant.hpp b/sprout/variant/variant.hpp index 9f24dbf5..ea335353 100644 --- a/sprout/variant/variant.hpp +++ b/sprout/variant/variant.hpp @@ -38,7 +38,7 @@ namespace sprout { {} template SPROUT_CONSTEXPR variant_impl(T&& operand, Index) - : tuple_(init(sprout::forward(operand), typename sprout::index_range<0, Index::value>::type())) + : tuple_(init(sprout::forward(operand), sprout::index_range<0, Index::value>::make())) , which_(Index::value) { static_assert(Index::value < sizeof...(Types), "variant<>: invalid operand");