From 21cefe8a679703479c7d60483597501cd350086e Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Wed, 7 Aug 2013 22:13:03 +0900 Subject: [PATCH] fix template-parameter name: Iterator, Range --- sprout/algorithm/fixed/deprecated/sort.hpp | 12 +-- sprout/algorithm/fixed/next_permutation.hpp | 26 ++++-- sprout/algorithm/fixed/prev_permutation.hpp | 26 ++++-- sprout/checksum/md5.hpp | 32 +++---- sprout/checksum/sha1.hpp | 81 +++++++++-------- sprout/checksum/sum.hpp | 28 +++--- sprout/checksum/xor.hpp | 28 +++--- sprout/functional/hash/hash_fwd.hpp | 8 +- sprout/io.hpp | 4 +- sprout/range/algorithm/adjacent_find.hpp | 56 ++++++------ sprout/range/algorithm/all_of.hpp | 4 +- sprout/range/algorithm/all_of_equal.hpp | 4 +- sprout/range/algorithm/any_of.hpp | 4 +- sprout/range/algorithm/any_of_equal.hpp | 4 +- sprout/range/algorithm/binary_search.hpp | 8 +- sprout/range/algorithm/count.hpp | 6 +- sprout/range/algorithm/count_if.hpp | 6 +- sprout/range/algorithm/equal.hpp | 8 +- sprout/range/algorithm/equal_range.hpp | 28 +++--- sprout/range/algorithm/find.hpp | 28 +++--- sprout/range/algorithm/find_difference.hpp | 32 +++---- sprout/range/algorithm/find_end.hpp | 72 +++++++-------- sprout/range/algorithm/find_first_of.hpp | 72 +++++++-------- sprout/range/algorithm/find_if.hpp | 28 +++--- sprout/range/algorithm/find_if_not.hpp | 28 +++--- sprout/range/algorithm/find_intersection.hpp | 32 +++---- .../algorithm/find_symmetric_difference.hpp | 32 +++---- sprout/range/algorithm/includes.hpp | 8 +- sprout/range/algorithm/is_decreasing.hpp | 4 +- sprout/range/algorithm/is_heap.hpp | 8 +- sprout/range/algorithm/is_heap_until.hpp | 56 ++++++------ sprout/range/algorithm/is_increasing.hpp | 4 +- sprout/range/algorithm/is_partitioned.hpp | 4 +- sprout/range/algorithm/is_permutation.hpp | 8 +- sprout/range/algorithm/is_sorted.hpp | 8 +- sprout/range/algorithm/is_sorted_until.hpp | 56 ++++++------ .../algorithm/is_strictly_decreasing.hpp | 4 +- .../algorithm/is_strictly_increasing.hpp | 4 +- .../algorithm/lexicographical_compare.hpp | 8 +- sprout/range/algorithm/lower_bound.hpp | 56 ++++++------ sprout/range/algorithm/max_element.hpp | 56 ++++++------ sprout/range/algorithm/min_element.hpp | 56 ++++++------ sprout/range/algorithm/minmax_element.hpp | 88 +++++++++---------- sprout/range/algorithm/mismatch.hpp | 28 +++--- sprout/range/algorithm/next_difference.hpp | 32 +++---- sprout/range/algorithm/next_intersection.hpp | 32 +++---- sprout/range/algorithm/next_union.hpp | 32 +++---- sprout/range/algorithm/none_of.hpp | 4 +- sprout/range/algorithm/none_of_equal.hpp | 4 +- sprout/range/algorithm/one_of.hpp | 4 +- sprout/range/algorithm/one_of_equal.hpp | 4 +- sprout/range/algorithm/partition_point.hpp | 14 +-- sprout/range/algorithm/search.hpp | 72 +++++++-------- sprout/range/algorithm/search_n.hpp | 56 ++++++------ .../tristate_lexicographical_compare.hpp | 16 ++-- sprout/range/algorithm/upper_bound.hpp | 56 ++++++------ sprout/range/numeric/accumulate.hpp | 8 +- sprout/range/numeric/inner_product.hpp | 8 +- sprout/uuid/string_generator.hpp | 58 ++++++------ sprout/uuid/udl.hpp | 12 +-- testspr/algorithm.hpp | 18 ++-- testspr/print.hpp | 10 +-- 62 files changed, 809 insertions(+), 784 deletions(-) diff --git a/sprout/algorithm/fixed/deprecated/sort.hpp b/sprout/algorithm/fixed/deprecated/sort.hpp index 87d32839..b3bbe084 100644 --- a/sprout/algorithm/fixed/deprecated/sort.hpp +++ b/sprout/algorithm/fixed/deprecated/sort.hpp @@ -33,20 +33,20 @@ namespace sprout { Compare comp ); - template + template inline SPROUT_CONSTEXPR typename sprout::container_traits::value_type const& sort_select_pivot( - Iterator origin, + RandomAccessIterator origin, typename sprout::container_traits::difference_type start, typename sprout::container_traits::difference_type end ) { // pivot を選ぶ(中央の要素) return *sprout::next(origin, (end + start) / 2); } - template + template inline SPROUT_CONSTEXPR typename sprout::container_traits::difference_type sort_find_l( - Iterator origin, + RandomAccessIterator origin, Compare comp, typename sprout::container_traits::difference_type l, typename sprout::container_traits::value_type const& p @@ -57,10 +57,10 @@ namespace sprout { : l ; } - template + template inline SPROUT_CONSTEXPR typename sprout::container_traits::difference_type sort_find_r( - Iterator origin, + RandomAccessIterator origin, Compare comp, typename sprout::container_traits::difference_type r, typename sprout::container_traits::value_type const& p diff --git a/sprout/algorithm/fixed/next_permutation.hpp b/sprout/algorithm/fixed/next_permutation.hpp index e22f84a7..4d6b8c52 100644 --- a/sprout/algorithm/fixed/next_permutation.hpp +++ b/sprout/algorithm/fixed/next_permutation.hpp @@ -23,9 +23,14 @@ namespace sprout { true ); } - template + template inline SPROUT_CONSTEXPR Result - next_permutation_impl_3(Container const& cont, Compare comp, Iterator first, Iterator last, Iterator i, Iterator ii, Iterator j) { + next_permutation_impl_3( + Container const& cont, Compare comp, + BidirectionalIterator first, BidirectionalIterator last, + BidirectionalIterator i, BidirectionalIterator ii, BidirectionalIterator j + ) + { return !comp(*i, *sprout::prev(j)) ? sprout::fixed::detail::next_permutation_impl_3( cont, comp, first, last, i, ii, sprout::prev(j) @@ -36,9 +41,14 @@ namespace sprout { ) ; } - template + template inline SPROUT_CONSTEXPR Result - next_permutation_impl_2(Container const& cont, Compare comp, Iterator first, Iterator last, Iterator i, Iterator ii) { + next_permutation_impl_2( + Container const& cont, Compare comp, + BidirectionalIterator first, BidirectionalIterator last, + BidirectionalIterator i, BidirectionalIterator ii + ) + { return comp(*i, *ii) ? sprout::fixed::detail::next_permutation_impl_3( cont, comp, first, last, i, ii, last @@ -50,9 +60,9 @@ namespace sprout { ) ; } - template + template inline SPROUT_CONSTEXPR Result - next_permutation_impl_1(Container const& cont, Compare comp, Iterator first, Iterator last, Iterator i) { + next_permutation_impl_1(Container const& cont, Compare comp, BidirectionalIterator first, BidirectionalIterator last, BidirectionalIterator i) { return i == last ? Result(sprout::deep_copy(cont), false) : sprout::fixed::detail::next_permutation_impl_2( cont, comp, first, last, @@ -60,9 +70,9 @@ namespace sprout { ) ; } - template + template inline SPROUT_CONSTEXPR Result - next_permutation_impl(Container const& cont, Compare comp, Iterator first, Iterator last) { + next_permutation_impl(Container const& cont, Compare comp, BidirectionalIterator first, BidirectionalIterator last) { return first == last ? Result(sprout::deep_copy(cont), false) : sprout::fixed::detail::next_permutation_impl_1( cont, comp, first, last, diff --git a/sprout/algorithm/fixed/prev_permutation.hpp b/sprout/algorithm/fixed/prev_permutation.hpp index d1137a54..35553e8b 100644 --- a/sprout/algorithm/fixed/prev_permutation.hpp +++ b/sprout/algorithm/fixed/prev_permutation.hpp @@ -23,9 +23,14 @@ namespace sprout { true ); } - template + template inline SPROUT_CONSTEXPR Result - prev_permutation_impl_3(Container const& cont, Compare comp, Iterator first, Iterator last, Iterator i, Iterator ii, Iterator j) { + prev_permutation_impl_3( + Container const& cont, Compare comp, + BidirectionalIterator first, BidirectionalIterator last, + BidirectionalIterator i, BidirectionalIterator ii, BidirectionalIterator j + ) + { return !comp(*sprout::prev(j), *i) ? sprout::fixed::detail::prev_permutation_impl_3( cont, comp, first, last, i, ii, sprout::prev(j) @@ -36,9 +41,14 @@ namespace sprout { ) ; } - template + template inline SPROUT_CONSTEXPR Result - prev_permutation_impl_2(Container const& cont, Compare comp, Iterator first, Iterator last, Iterator i, Iterator ii) { + prev_permutation_impl_2( + Container const& cont, Compare comp, + BidirectionalIterator first, BidirectionalIterator last, + BidirectionalIterator i, BidirectionalIterator ii + ) + { return comp(*ii, *i) ? sprout::fixed::detail::prev_permutation_impl_3( cont, comp, first, last, i, ii, last @@ -50,9 +60,9 @@ namespace sprout { ) ; } - template + template inline SPROUT_CONSTEXPR Result - prev_permutation_impl_1(Container const& cont, Compare comp, Iterator first, Iterator last, Iterator i) { + prev_permutation_impl_1(Container const& cont, Compare comp, BidirectionalIterator first, BidirectionalIterator last, BidirectionalIterator i) { return i == last ? Result(sprout::deep_copy(cont), false) : sprout::fixed::detail::prev_permutation_impl_2( cont, comp, first, last, @@ -60,9 +70,9 @@ namespace sprout { ) ; } - template + template inline SPROUT_CONSTEXPR Result - prev_permutation_impl(Container const& cont, Compare comp, Iterator first, Iterator last) { + prev_permutation_impl(Container const& cont, Compare comp, BidirectionalIterator first, BidirectionalIterator last) { return first == last ? Result(sprout::deep_copy(cont), false) : sprout::fixed::detail::prev_permutation_impl_1( cont, comp, first, last, diff --git a/sprout/checksum/md5.hpp b/sprout/checksum/md5.hpp index 04318459..67853c58 100644 --- a/sprout/checksum/md5.hpp +++ b/sprout/checksum/md5.hpp @@ -291,8 +291,8 @@ namespace sprout { bit_count_ + 8 ); } - template - SPROUT_CONSTEXPR md5 const process_block_impl(Iterator first, Iterator last) const { + template + SPROUT_CONSTEXPR md5 const process_block_impl(InputIterator first, InputIterator last) const { return first == last ? *this : process_byte(*first).process_block_impl(sprout::next(first), last) ; @@ -344,8 +344,8 @@ namespace sprout { k_[3] += x[3]; block_.assign(0); } - template - void process_block_impl(Iterator first, Iterator last) { + template + void process_block_impl(InputIterator first, InputIterator last) { for(; first != last; ++first) { process_byte(*first); } @@ -391,19 +391,19 @@ namespace sprout { .process_bit((byte & 1) != 0) ; } - template - SPROUT_CONSTEXPR md5 const process_block(Iterator bytes_begin, Iterator bytes_end) const { + template + SPROUT_CONSTEXPR md5 const process_block(InputIterator bytes_begin, InputIterator bytes_end) const { return process_block_impl( sprout::make_bytes_iterator(bytes_begin), sprout::make_bytes_iterator(bytes_end) ); } - template - SPROUT_CONSTEXPR md5 const process_bytes(Iterator buffer, std::size_t byte_count) const { + template + SPROUT_CONSTEXPR md5 const process_bytes(InputIterator buffer, std::size_t byte_count) const { return process_block(buffer, sprout::next(buffer, byte_count)); } - template - SPROUT_CONSTEXPR md5 const process_range(Range const& bytes_range) const { + template + SPROUT_CONSTEXPR md5 const process_range(InputRange const& bytes_range) const { return process_block(sprout::begin(bytes_range), sprout::end(bytes_range)); } @@ -423,19 +423,19 @@ namespace sprout { void process_byte(std::uint8_t byte) { process_bits(byte, 8); } - template - void process_block(Iterator bytes_begin, Iterator bytes_end) { + template + void process_block(InputIterator bytes_begin, InputIterator bytes_end) { process_block_impl( sprout::make_bytes_iterator(bytes_begin), sprout::make_bytes_iterator(bytes_end) ); } - template - void process_bytes(Iterator buffer, std::size_t byte_count) { + template + void process_bytes(InputIterator buffer, std::size_t byte_count) { process_block(buffer, sprout::next(buffer, byte_count)); } - template - void process_range(Range const& bytes_range) { + template + void process_range(InputRange const& bytes_range) { process_block(sprout::begin(bytes_range), sprout::end(bytes_range)); } diff --git a/sprout/checksum/sha1.hpp b/sprout/checksum/sha1.hpp index 0bfcdfe6..bacaa7f5 100644 --- a/sprout/checksum/sha1.hpp +++ b/sprout/checksum/sha1.hpp @@ -151,49 +151,54 @@ namespace sprout { SPROUT_CONSTEXPR sha1 const process_block() const { return sprout::throw_recursive_function_template_instantiation_exeeded(); } - template + template SPROUT_CONSTEXPR typename std::enable_if::type - process_block_impl(Iterator first, Iterator last, Args... args) const { + process_block_impl(InputIterator first, InputIterator last, Args... args) const { return first == last ? process( h_, sprout::make_array(args...), 64, bit_count_ + 64 * 8 ) - : /*process( - h_, - sprout::make_array(args...), - 64, - bit_count_ + 64 * 8 - ).template process_block_impl(first, last)*/ sprout::throw_recursive_function_template_instantiation_exeeded() + // !!! +// : process( +// h_, +// sprout::make_array(args...), +// 64, +// bit_count_ + 64 * 8 +// ).template process_block_impl(first, last) + : sprout::throw_recursive_function_template_instantiation_exeeded() ; } - template + template SPROUT_CONSTEXPR typename std::enable_if::type - process_block_impl(Iterator, Iterator, Args...) const { + process_block_impl(InputIterator, InputIterator, Args...) const { return sprout::throw_recursive_function_template_instantiation_exeeded(); } - template + template SPROUT_CONSTEXPR typename std::enable_if::type - process_block_impl(Iterator first, Iterator last, Args... args) const { + process_block_impl(InputIterator first, InputIterator last, Args... args) const { return first == last ? process( h_, sprout::get_internal(sprout::range::fixed::copy(sprout::make_array(args...), sprout::sub(block_, block_byte_index_))), block_byte_index_ + sizeof...(Args), bit_count_ + sizeof...(Args) * 8 ) - : block_byte_index_ + sizeof...(Args) == 64 ? /*process( - h_, - sprout::get_internal(sprout::range::fixed::copy(sprout::make_array(args...), sprout::sub(block_, block_byte_index_))), - block_byte_index_ + sizeof...(Args), - bit_count_ + sizeof...(Args) * 8 - ).template process_block_impl(first, last)*/ sprout::throw_recursive_function_template_instantiation_exeeded() + : block_byte_index_ + sizeof...(Args) == 64 + // !!! +// ? process( +// h_, +// sprout::get_internal(sprout::range::fixed::copy(sprout::make_array(args...), sprout::sub(block_, block_byte_index_))), +// block_byte_index_ + sizeof...(Args), +// bit_count_ + sizeof...(Args) * 8 +// ).template process_block_impl(first, last) + ? sprout::throw_recursive_function_template_instantiation_exeeded() : process_block_impl(sprout::next(first), last, args..., *first) ; } - template + template SPROUT_CONSTEXPR typename std::enable_if::type - process_block_impl(Iterator, Iterator, Args...) const { + process_block_impl(InputIterator, InputIterator, Args...) const { return sprout::throw_recursive_function_template_instantiation_exeeded(); } #else @@ -253,9 +258,9 @@ namespace sprout { SPROUT_CONSTEXPR sha1 const process_block() const { return process_block_1(h_[0], h_[1], h_[2], h_[3], h_[4]); } - template + template SPROUT_CONSTEXPR typename std::enable_if::type - process_block_impl(Iterator first, Iterator last, Args... args) const { + process_block_impl(InputIterator first, InputIterator last, Args... args) const { return first == last ? process( h_, sprout::make_array(args...), @@ -270,9 +275,9 @@ namespace sprout { ).process_block_impl(first, last) ; } - template + template SPROUT_CONSTEXPR typename std::enable_if::type - process_block_impl(Iterator first, Iterator last, Args... args) const { + process_block_impl(InputIterator first, InputIterator last, Args... args) const { return first == last ? process( h_, sprout::get_internal(sprout::range::fixed::copy(sprout::make_array(args...), sprout::sub(block_, block_byte_index_))), @@ -419,8 +424,8 @@ namespace sprout { process_block(); } } - template - void process_block_impl(Iterator first, Iterator last) { + template + void process_block_impl(InputIterator first, InputIterator last) { for(; first != last; ++first) { process_byte(*first); } @@ -450,19 +455,19 @@ namespace sprout { bit_count_ + 8 ); } - template - SPROUT_CONSTEXPR sha1 const process_block(Iterator bytes_begin, Iterator bytes_end) const { + template + SPROUT_CONSTEXPR sha1 const process_block(InputIterator bytes_begin, InputIterator bytes_end) const { return process_block_impl( sprout::make_bytes_iterator(bytes_begin), sprout::make_bytes_iterator(bytes_end) ); } - template - SPROUT_CONSTEXPR sha1 const process_bytes(Iterator buffer, std::size_t byte_count) const { + template + SPROUT_CONSTEXPR sha1 const process_bytes(InputIterator buffer, std::size_t byte_count) const { return process_block(buffer, sprout::next(buffer, byte_count)); } - template - SPROUT_CONSTEXPR sha1 const process_range(Range const& bytes_range) const { + template + SPROUT_CONSTEXPR sha1 const process_range(InputRange const& bytes_range) const { return process_block(sprout::begin(bytes_range), sprout::end(bytes_range)); } @@ -470,19 +475,19 @@ namespace sprout { process_byte_impl(byte); bit_count_ += 8; } - template - void process_block(Iterator bytes_begin, Iterator bytes_end) { + template + void process_block(InputIterator bytes_begin, InputIterator bytes_end) { process_block_impl( sprout::make_bytes_iterator(bytes_begin), sprout::make_bytes_iterator(bytes_end) ); } - template - void process_bytes(Iterator buffer, std::size_t byte_count) { + template + void process_bytes(InputIterator buffer, std::size_t byte_count) { process_block(buffer, sprout::next(buffer, byte_count)); } - template - void process_range(Range const& bytes_range) { + template + void process_range(InputRange const& bytes_range) { process_block(sprout::begin(bytes_range), sprout::end(bytes_range)); } diff --git a/sprout/checksum/sum.hpp b/sprout/checksum/sum.hpp index 1f515b63..49e5ef43 100644 --- a/sprout/checksum/sum.hpp +++ b/sprout/checksum/sum.hpp @@ -33,8 +33,8 @@ namespace sprout { private: sum_type sum_; private: - template - SPROUT_CONSTEXPR sum_type calc_sum(Iterator first, Iterator last) const { + template + SPROUT_CONSTEXPR sum_type calc_sum(InputIterator first, InputIterator last) const { return sprout::accumulate( sprout::make_bytes_iterator(first), sprout::make_bytes_iterator(last), @@ -54,32 +54,32 @@ namespace sprout { SPROUT_CONSTEXPR sum_basic const process_byte(std::uint8_t byte) const { return sum_basic(sum_ + byte); } - template - SPROUT_CONSTEXPR sum_basic const process_block(Iterator bytes_begin, Iterator bytes_end) const { + template + SPROUT_CONSTEXPR sum_basic const process_block(InputIterator bytes_begin, InputIterator bytes_end) const { return sum_basic(calc_sum(bytes_begin, bytes_end)); } - template - SPROUT_CONSTEXPR sum_basic const process_bytes(Iterator buffer, std::size_t byte_count) const { + template + SPROUT_CONSTEXPR sum_basic const process_bytes(InputIterator buffer, std::size_t byte_count) const { return process_block(buffer, sprout::next(buffer, byte_count)); } - template - SPROUT_CONSTEXPR sum_basic const process_range(Range const& bytes_range) const { + template + SPROUT_CONSTEXPR sum_basic const process_range(InputRange const& bytes_range) const { return process_block(sprout::begin(bytes_range), sprout::end(bytes_range)); } void process_byte(std::uint8_t byte) { sum_ += byte; } - template - void process_block(Iterator bytes_begin, Iterator bytes_end) { + template + void process_block(InputIterator bytes_begin, InputIterator bytes_end) { sum_ = calc_sum(bytes_begin, bytes_end); } - template - void process_bytes(Iterator buffer, std::size_t byte_count) { + template + void process_bytes(InputIterator buffer, std::size_t byte_count) { process_block(buffer, sprout::next(buffer, byte_count)); } - template - void process_range(Range const& bytes_range) { + template + void process_range(InputRange const& bytes_range) { process_block(sprout::begin(bytes_range), sprout::end(bytes_range)); } diff --git a/sprout/checksum/xor.hpp b/sprout/checksum/xor.hpp index cf7df782..03f22011 100644 --- a/sprout/checksum/xor.hpp +++ b/sprout/checksum/xor.hpp @@ -22,8 +22,8 @@ namespace sprout { private: sum_type sum_; private: - template - SPROUT_CONSTEXPR sum_type calc_sum(Iterator first, Iterator last) const { + template + SPROUT_CONSTEXPR sum_type calc_sum(InputIterator first, InputIterator last) const { return sprout::accumulate( sprout::make_bytes_iterator(first), sprout::make_bytes_iterator(last), @@ -43,32 +43,32 @@ namespace sprout { SPROUT_CONSTEXPR xor8 const process_byte(std::uint8_t byte) const { return xor8(sum_ ^ byte); } - template - SPROUT_CONSTEXPR xor8 const process_block(Iterator bytes_begin, Iterator bytes_end) const { + template + SPROUT_CONSTEXPR xor8 const process_block(InputIterator bytes_begin, InputIterator bytes_end) const { return xor8(calc_sum(bytes_begin, bytes_end)); } - template - SPROUT_CONSTEXPR xor8 const process_bytes(Iterator buffer, std::size_t byte_count) const { + template + SPROUT_CONSTEXPR xor8 const process_bytes(InputIterator buffer, std::size_t byte_count) const { return process_block(buffer, sprout::next(buffer, byte_count)); } - template - SPROUT_CONSTEXPR xor8 const process_range(Range const& bytes_range) const { + template + SPROUT_CONSTEXPR xor8 const process_range(InputRange const& bytes_range) const { return process_block(sprout::begin(bytes_range), sprout::end(bytes_range)); } void process_byte(std::uint8_t byte) { sum_ ^= byte; } - template - void process_block(Iterator bytes_begin, Iterator bytes_end) { + template + void process_block(InputIterator bytes_begin, InputIterator bytes_end) { sum_ = calc_sum(bytes_begin, bytes_end); } - template - void process_bytes(Iterator buffer, std::size_t byte_count) { + template + void process_bytes(InputIterator buffer, std::size_t byte_count) { process_block(buffer, sprout::next(buffer, byte_count)); } - template - void process_range(Range const& bytes_range) { + template + void process_range(InputRange const& bytes_range) { process_block(sprout::begin(bytes_range), sprout::end(bytes_range)); } diff --git a/sprout/functional/hash/hash_fwd.hpp b/sprout/functional/hash/hash_fwd.hpp index 7c86f62e..0660c466 100644 --- a/sprout/functional/hash/hash_fwd.hpp +++ b/sprout/functional/hash/hash_fwd.hpp @@ -41,10 +41,10 @@ namespace sprout { // // hash_range // - template - SPROUT_CONSTEXPR std::size_t hash_range(std::size_t seed, Iterator first, Iterator last); - template - SPROUT_CONSTEXPR std::size_t hash_range(Iterator first, Iterator last); + template + SPROUT_CONSTEXPR std::size_t hash_range(std::size_t seed, InputIterator first, InputIterator last); + template + SPROUT_CONSTEXPR std::size_t hash_range(InputIterator first, InputIterator last); template SPROUT_CONSTEXPR std::size_t hash_range(std::size_t seed, InputRange const& rng); template diff --git a/sprout/io.hpp b/sprout/io.hpp index 798989f4..455ddd27 100644 --- a/sprout/io.hpp +++ b/sprout/io.hpp @@ -729,9 +729,9 @@ namespace sprout { } namespace detail { - template + template inline SPROUT_CONSTEXPR Elem - get_param(Iterator found, sprout::array const& sizes, std::size_t idx, Args const&... args) { + get_param(RandomAccessIterator found, sprout::array const& sizes, std::size_t idx, Args const&... args) { return found == sizes.end() ? static_cast('\0') : sprout::detail::param_seq_at( found - sizes.begin(), diff --git a/sprout/range/algorithm/adjacent_find.hpp b/sprout/range/algorithm/adjacent_find.hpp index 04dfcc82..ed7d355a 100644 --- a/sprout/range/algorithm/adjacent_find.hpp +++ b/sprout/range/algorithm/adjacent_find.hpp @@ -12,53 +12,53 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.2.8 Adjacent find - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - adjacent_find(Range&& range) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + adjacent_find(ForwardRange&& range) { + return sprout::range::range_return::pack( sprout::adjacent_find( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)) + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)) ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - adjacent_find(Range&& range, BinaryPredicate pred) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + adjacent_find(ForwardRange&& range, BinaryPredicate pred) { + return sprout::range::range_return::pack( sprout::adjacent_find( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), pred ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - adjacent_find(Range&& range) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + adjacent_find(ForwardRange&& range) { + return sprout::range::range_return::pack( sprout::adjacent_find( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)) + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)) ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - adjacent_find(Range&& range, BinaryPredicate pred) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + adjacent_find(ForwardRange&& range, BinaryPredicate pred) { + return sprout::range::range_return::pack( sprout::adjacent_find( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), pred ), - sprout::forward(range) + sprout::forward(range) ); } } // namespace range diff --git a/sprout/range/algorithm/all_of.hpp b/sprout/range/algorithm/all_of.hpp index 869dfd9c..c3d62a04 100644 --- a/sprout/range/algorithm/all_of.hpp +++ b/sprout/range/algorithm/all_of.hpp @@ -10,9 +10,9 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.2.1 All of - template + template inline SPROUT_CONSTEXPR bool - all_of(Range const& range, Predicate pred) { + all_of(InputRange const& range, Predicate pred) { return sprout::all_of(sprout::begin(range), sprout::end(range), pred); } } // namespace range diff --git a/sprout/range/algorithm/all_of_equal.hpp b/sprout/range/algorithm/all_of_equal.hpp index 1ab79d43..318807c0 100644 --- a/sprout/range/algorithm/all_of_equal.hpp +++ b/sprout/range/algorithm/all_of_equal.hpp @@ -10,9 +10,9 @@ namespace sprout { // // all_of_equal // - template + template inline SPROUT_CONSTEXPR bool - all_of_equal(Range const& range, T const& value) { + all_of_equal(InputRange const& range, T const& value) { return sprout::all_of_equal(sprout::begin(range), sprout::end(range), value); } } // namespace range diff --git a/sprout/range/algorithm/any_of.hpp b/sprout/range/algorithm/any_of.hpp index 72a66359..56d4e94d 100644 --- a/sprout/range/algorithm/any_of.hpp +++ b/sprout/range/algorithm/any_of.hpp @@ -10,9 +10,9 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.2.2 Any of - template + template inline SPROUT_CONSTEXPR bool - any_of(Range const& range, Predicate pred) { + any_of(InputRange const& range, Predicate pred) { return sprout::any_of(sprout::begin(range), sprout::end(range), pred); } } // namespace range diff --git a/sprout/range/algorithm/any_of_equal.hpp b/sprout/range/algorithm/any_of_equal.hpp index 3c317c38..2c0dcd7b 100644 --- a/sprout/range/algorithm/any_of_equal.hpp +++ b/sprout/range/algorithm/any_of_equal.hpp @@ -10,9 +10,9 @@ namespace sprout { // // any_of_equal // - template + template inline SPROUT_CONSTEXPR bool - any_of_equal(Range const& range, T const& value) { + any_of_equal(InputRange const& range, T const& value) { return sprout::any_of_equal(sprout::begin(range), sprout::end(range), value); } } // namespace range diff --git a/sprout/range/algorithm/binary_search.hpp b/sprout/range/algorithm/binary_search.hpp index 007b18ec..e3220fef 100644 --- a/sprout/range/algorithm/binary_search.hpp +++ b/sprout/range/algorithm/binary_search.hpp @@ -10,15 +10,15 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.4.3.4 binary_search - template + template inline SPROUT_CONSTEXPR bool - binary_search(Range const& range, T const& value) { + binary_search(ForwardRange const& range, T const& value) { return sprout::binary_search(sprout::begin(range), sprout::end(range), value); } - template + template inline SPROUT_CONSTEXPR bool - binary_search(Range const& range, T const& value, Compare comp) { + binary_search(ForwardRange const& range, T const& value, Compare comp) { return sprout::binary_search(sprout::begin(range), sprout::end(range), value, comp); } } // namespace range diff --git a/sprout/range/algorithm/count.hpp b/sprout/range/algorithm/count.hpp index 5f625f85..c5444a3f 100644 --- a/sprout/range/algorithm/count.hpp +++ b/sprout/range/algorithm/count.hpp @@ -11,9 +11,9 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.2.9 Count - template - inline SPROUT_CONSTEXPR typename sprout::container_traits::difference_type - count(Range const& range, T const& value) { + template + inline SPROUT_CONSTEXPR typename sprout::container_traits::difference_type + count(InputRange const& range, T const& value) { return sprout::count(sprout::begin(range), sprout::end(range), value); } } // namespace range diff --git a/sprout/range/algorithm/count_if.hpp b/sprout/range/algorithm/count_if.hpp index 2af5f103..01b91082 100644 --- a/sprout/range/algorithm/count_if.hpp +++ b/sprout/range/algorithm/count_if.hpp @@ -11,9 +11,9 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.2.9 Count - template - inline SPROUT_CONSTEXPR typename sprout::container_traits::difference_type - count_if(Range const& range, Predicate pred) { + template + inline SPROUT_CONSTEXPR typename sprout::container_traits::difference_type + count_if(InputRange const& range, Predicate pred) { return sprout::count_if(sprout::begin(range), sprout::end(range), pred); } } // namespace range diff --git a/sprout/range/algorithm/equal.hpp b/sprout/range/algorithm/equal.hpp index 56e3de7d..18831fb1 100644 --- a/sprout/range/algorithm/equal.hpp +++ b/sprout/range/algorithm/equal.hpp @@ -10,15 +10,15 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.2.11 Equal - template + template inline SPROUT_CONSTEXPR bool - equal(Range1 const& range1, Range2 const& range2) { + equal(InputRange1 const& range1, InputRange2 const& range2) { return sprout::equal(sprout::begin(range1), sprout::end(range1), sprout::begin(range2)); } - template + template inline SPROUT_CONSTEXPR bool - equal(Range1 const& range1, Range2 const& range2, BinaryPredicate pred) { + equal(InputRange1 const& range1, InputRange2 const& range2, BinaryPredicate pred) { return sprout::equal(sprout::begin(range1), sprout::end(range1), sprout::begin(range2), pred); } } // namespace range diff --git a/sprout/range/algorithm/equal_range.hpp b/sprout/range/algorithm/equal_range.hpp index 3afbace1..323cd06d 100644 --- a/sprout/range/algorithm/equal_range.hpp +++ b/sprout/range/algorithm/equal_range.hpp @@ -10,8 +10,8 @@ namespace sprout { namespace range { namespace detail { - template - inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range::type + template + inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range::type pair_to_range(Pair const& pair) { return {pair.first, pair.second}; } @@ -20,25 +20,25 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.4.3.3 equal_range - template - inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range::type - equal_range(Range&& range, T const& value) { - return sprout::range::detail::pair_to_range( + template + inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range::type + equal_range(ForwardRange&& range, T const& value) { + return sprout::range::detail::pair_to_range( sprout::equal_range( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), value ) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range::type - equal_range(Range&& range, T const& value, Compare comp) { - return sprout::range::detail::pair_to_range( + template + inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range::type + equal_range(ForwardRange&& range, T const& value, Compare comp) { + return sprout::range::detail::pair_to_range( sprout::equal_range( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), value, comp ) diff --git a/sprout/range/algorithm/find.hpp b/sprout/range/algorithm/find.hpp index e2aec459..5cf1dbd9 100644 --- a/sprout/range/algorithm/find.hpp +++ b/sprout/range/algorithm/find.hpp @@ -12,29 +12,29 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.2.5 Find - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - find(Range&& range, T const& value) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + find(InputRange&& range, T const& value) { + return sprout::range::range_return::pack( sprout::find( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), value ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - find(Range&& range, T const& value) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + find(InputRange&& range, T const& value) { + return sprout::range::range_return::pack( sprout::find( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), value ), - sprout::forward(range) + sprout::forward(range) ); } } // namespace range diff --git a/sprout/range/algorithm/find_difference.hpp b/sprout/range/algorithm/find_difference.hpp index 6c23a49b..0aa4f612 100644 --- a/sprout/range/algorithm/find_difference.hpp +++ b/sprout/range/algorithm/find_difference.hpp @@ -13,32 +13,32 @@ namespace sprout { // // find_difference // - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::lvalue_iterator::type, - typename sprout::range::lvalue_iterator::type + typename sprout::range::lvalue_iterator::type, + typename sprout::range::lvalue_iterator::type > - find_difference(Range1&& range1, Range2&& range2, Compare comp) { + find_difference(InputRange1&& range1, InputRange2&& range2, Compare comp) { return sprout::find_difference( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)), + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)), comp ); } - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::lvalue_iterator::type, - typename sprout::range::lvalue_iterator::type + typename sprout::range::lvalue_iterator::type, + typename sprout::range::lvalue_iterator::type > - find_difference(Range1&& range1, Range2&& range2) { + find_difference(InputRange1&& range1, InputRange2&& range2) { return sprout::find_difference( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)) + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)) ); } } // namespace range diff --git a/sprout/range/algorithm/find_end.hpp b/sprout/range/algorithm/find_end.hpp index 4a8b013e..dcfb8930 100644 --- a/sprout/range/algorithm/find_end.hpp +++ b/sprout/range/algorithm/find_end.hpp @@ -12,61 +12,61 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.2.6 Find end - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - find_end(Range1&& range1, Range2&& range2) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + find_end(ForwardRange1&& range1, ForwardRange2&& range2) { + return sprout::range::range_return::pack( sprout::find_end( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)) + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)) ), - sprout::forward(range1) + sprout::forward(range1) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - find_end(Range1&& range1, Range2&& range2, BinaryPredicate pred) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + find_end(ForwardRange1&& range1, ForwardRange2&& range2, BinaryPredicate pred) { + return sprout::range::range_return::pack( sprout::find_end( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)), + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)), pred ), - sprout::forward(range1) + sprout::forward(range1) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - find_end(Range1&& range1, Range2&& range2) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + find_end(ForwardRange1&& range1, ForwardRange2&& range2) { + return sprout::range::range_return::pack( sprout::find_end( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)) + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)) ), - sprout::forward(range1) + sprout::forward(range1) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - find_end(Range1&& range1, Range2&& range2, BinaryPredicate pred) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + find_end(ForwardRange1&& range1, ForwardRange2&& range2, BinaryPredicate pred) { + return sprout::range::range_return::pack( sprout::find_end( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)), + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)), pred ), - sprout::forward(range1) + sprout::forward(range1) ); } } // namespace range diff --git a/sprout/range/algorithm/find_first_of.hpp b/sprout/range/algorithm/find_first_of.hpp index 520d9c94..8849bd9f 100644 --- a/sprout/range/algorithm/find_first_of.hpp +++ b/sprout/range/algorithm/find_first_of.hpp @@ -12,61 +12,61 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.2.7 Find first - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - find_first_of(Range1&& range1, Range2&& range2) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + find_first_of(InputRange1&& range1, InputRange2&& range2) { + return sprout::range::range_return::pack( sprout::find_first_of( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)) + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)) ), - sprout::forward(range1) + sprout::forward(range1) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - find_first_of(Range1&& range1, Range2&& range2, BinaryPredicate pred) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + find_first_of(InputRange1&& range1, InputRange2&& range2, BinaryPredicate pred) { + return sprout::range::range_return::pack( sprout::find_first_of( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)), + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)), pred ), - sprout::forward(range1) + sprout::forward(range1) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - find_first_of(Range1&& range1, Range2&& range2) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + find_first_of(InputRange1&& range1, InputRange2&& range2) { + return sprout::range::range_return::pack( sprout::find_first_of( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)) + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)) ), - sprout::forward(range1) + sprout::forward(range1) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - find_first_of(Range1&& range1, Range2&& range2, BinaryPredicate pred) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + find_first_of(InputRange1&& range1, InputRange2&& range2, BinaryPredicate pred) { + return sprout::range::range_return::pack( sprout::find_first_of( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)), + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)), pred ), - sprout::forward(range1) + sprout::forward(range1) ); } } // namespace range diff --git a/sprout/range/algorithm/find_if.hpp b/sprout/range/algorithm/find_if.hpp index 0c3cd83d..a94eac1f 100644 --- a/sprout/range/algorithm/find_if.hpp +++ b/sprout/range/algorithm/find_if.hpp @@ -12,29 +12,29 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.2.5 Find - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - find_if(Range&& range, Predicate pred) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + find_if(InputRange&& range, Predicate pred) { + return sprout::range::range_return::pack( sprout::find_if( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), pred ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - find_if(Range&& range, Predicate pred) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + find_if(InputRange&& range, Predicate pred) { + return sprout::range::range_return::pack( sprout::find_if( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), pred ), - sprout::forward(range) + sprout::forward(range) ); } } // namespace range diff --git a/sprout/range/algorithm/find_if_not.hpp b/sprout/range/algorithm/find_if_not.hpp index 6d074ada..816b9fc2 100644 --- a/sprout/range/algorithm/find_if_not.hpp +++ b/sprout/range/algorithm/find_if_not.hpp @@ -12,29 +12,29 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.2.5 Find - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - find_if_not(Range&& range, Predicate pred) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + find_if_not(InputRange&& range, Predicate pred) { + return sprout::range::range_return::pack( sprout::find_if_not( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), pred ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - find_if_not(Range&& range, Predicate pred) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + find_if_not(InputRange&& range, Predicate pred) { + return sprout::range::range_return::pack( sprout::find_if_not( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), pred ), - sprout::forward(range) + sprout::forward(range) ); } } // namespace range diff --git a/sprout/range/algorithm/find_intersection.hpp b/sprout/range/algorithm/find_intersection.hpp index 8f66ab90..ff4b0fdb 100644 --- a/sprout/range/algorithm/find_intersection.hpp +++ b/sprout/range/algorithm/find_intersection.hpp @@ -13,32 +13,32 @@ namespace sprout { // // find_intersection // - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::lvalue_iterator::type, - typename sprout::range::lvalue_iterator::type + typename sprout::range::lvalue_iterator::type, + typename sprout::range::lvalue_iterator::type > - find_intersection(Range1&& range1, Range2&& range2, Compare comp) { + find_intersection(InputRange1&& range1, InputRange2&& range2, Compare comp) { return sprout::find_intersection( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)), + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)), comp ); } - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::lvalue_iterator::type, - typename sprout::range::lvalue_iterator::type + typename sprout::range::lvalue_iterator::type, + typename sprout::range::lvalue_iterator::type > - find_intersection(Range1&& range1, Range2&& range2) { + find_intersection(InputRange1&& range1, InputRange2&& range2) { return sprout::find_intersection( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)) + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)) ); } } // namespace range diff --git a/sprout/range/algorithm/find_symmetric_difference.hpp b/sprout/range/algorithm/find_symmetric_difference.hpp index 5a621c4f..0e5aa220 100644 --- a/sprout/range/algorithm/find_symmetric_difference.hpp +++ b/sprout/range/algorithm/find_symmetric_difference.hpp @@ -13,32 +13,32 @@ namespace sprout { // // find_symmetric_difference // - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::lvalue_iterator::type, - typename sprout::range::lvalue_iterator::type + typename sprout::range::lvalue_iterator::type, + typename sprout::range::lvalue_iterator::type > - find_symmetric_difference(Range1&& range1, Range2&& range2, Compare comp) { + find_symmetric_difference(InputRange1&& range1, InputRange2&& range2, Compare comp) { return sprout::find_symmetric_difference( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)), + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)), comp ); } - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::lvalue_iterator::type, - typename sprout::range::lvalue_iterator::type + typename sprout::range::lvalue_iterator::type, + typename sprout::range::lvalue_iterator::type > - find_symmetric_difference(Range1&& range1, Range2&& range2) { + find_symmetric_difference(InputRange1&& range1, InputRange2&& range2) { return sprout::find_symmetric_difference( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)) + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)) ); } } // namespace range diff --git a/sprout/range/algorithm/includes.hpp b/sprout/range/algorithm/includes.hpp index f8b4a3db..9291b208 100644 --- a/sprout/range/algorithm/includes.hpp +++ b/sprout/range/algorithm/includes.hpp @@ -10,15 +10,15 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.4.5.1 includes - template + template inline SPROUT_CONSTEXPR bool - includes(Range1 const& range1, Range2 const& range2) { + includes(InputRange1 const& range1, InputRange2 const& range2) { return sprout::includes(sprout::begin(range1), sprout::end(range1), sprout::begin(range2), sprout::end(range2)); } - template + template inline SPROUT_CONSTEXPR bool - includes(Range1 const& range1, Range2 const& range2, Compare comp) { + includes(InputRange1 const& range1, InputRange2 const& range2, Compare comp) { return sprout::includes(sprout::begin(range1), sprout::end(range1), sprout::begin(range2), sprout::end(range2), comp); } } // namespace range diff --git a/sprout/range/algorithm/is_decreasing.hpp b/sprout/range/algorithm/is_decreasing.hpp index b939255f..e6376545 100644 --- a/sprout/range/algorithm/is_decreasing.hpp +++ b/sprout/range/algorithm/is_decreasing.hpp @@ -10,9 +10,9 @@ namespace sprout { // // is_decreasing // - template + template inline SPROUT_CONSTEXPR bool - is_decreasing(Range const& range) { + is_decreasing(ForwardRange const& range) { return sprout::is_decreasing(sprout::begin(range), sprout::end(range)); } } // namespace range diff --git a/sprout/range/algorithm/is_heap.hpp b/sprout/range/algorithm/is_heap.hpp index 519f0ceb..de80a750 100644 --- a/sprout/range/algorithm/is_heap.hpp +++ b/sprout/range/algorithm/is_heap.hpp @@ -10,15 +10,15 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.4.6.5 is_heap - template + template inline SPROUT_CONSTEXPR bool - is_heap(Range const& range) { + is_heap(RandomAccessRange const& range) { return sprout::is_heap(sprout::begin(range), sprout::end(range)); } - template + template inline SPROUT_CONSTEXPR bool - is_heap(Range const& range, Compare comp) { + is_heap(RandomAccessRange const& range, Compare comp) { return sprout::is_heap(sprout::begin(range), sprout::end(range), comp); } } // namespace range diff --git a/sprout/range/algorithm/is_heap_until.hpp b/sprout/range/algorithm/is_heap_until.hpp index 062fa5d6..c8fd93ad 100644 --- a/sprout/range/algorithm/is_heap_until.hpp +++ b/sprout/range/algorithm/is_heap_until.hpp @@ -12,53 +12,53 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.4.6.5 is_heap - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - is_heap_until(Range&& range) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + is_heap_until(RandomAccessRange&& range) { + return sprout::range::range_return::pack( sprout::is_heap_until( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)) + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)) ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - is_heap_until(Range&& range, Compare comp) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + is_heap_until(RandomAccessRange&& range, Compare comp) { + return sprout::range::range_return::pack( sprout::is_heap_until( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), comp ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - is_heap_until(Range&& range) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + is_heap_until(RandomAccessRange&& range) { + return sprout::range::range_return::pack( sprout::is_heap_until( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)) + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)) ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - is_heap_until(Range&& range, Compare comp) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + is_heap_until(RandomAccessRange&& range, Compare comp) { + return sprout::range::range_return::pack( sprout::is_heap_until( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), comp ), - sprout::forward(range) + sprout::forward(range) ); } } // namespace range diff --git a/sprout/range/algorithm/is_increasing.hpp b/sprout/range/algorithm/is_increasing.hpp index b34627b8..d94446f0 100644 --- a/sprout/range/algorithm/is_increasing.hpp +++ b/sprout/range/algorithm/is_increasing.hpp @@ -10,9 +10,9 @@ namespace sprout { // // is_increasing // - template + template inline SPROUT_CONSTEXPR bool - is_increasing(Range const& range) { + is_increasing(ForwardRange const& range) { return sprout::is_increasing(sprout::begin(range), sprout::end(range)); } } // namespace range diff --git a/sprout/range/algorithm/is_partitioned.hpp b/sprout/range/algorithm/is_partitioned.hpp index 9ce70b5a..14874d90 100644 --- a/sprout/range/algorithm/is_partitioned.hpp +++ b/sprout/range/algorithm/is_partitioned.hpp @@ -10,9 +10,9 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.3.13 partitions - template + template inline SPROUT_CONSTEXPR bool - is_partitioned(Range const& range, Predicate pred) { + is_partitioned(InputRange const& range, Predicate pred) { return sprout::is_partitioned(sprout::begin(range), sprout::end(range), pred); } } // namespace range diff --git a/sprout/range/algorithm/is_permutation.hpp b/sprout/range/algorithm/is_permutation.hpp index 34660a80..721d665d 100644 --- a/sprout/range/algorithm/is_permutation.hpp +++ b/sprout/range/algorithm/is_permutation.hpp @@ -10,15 +10,15 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.2.12 Is permutation - template + template inline SPROUT_CONSTEXPR bool - is_permutation(Range1 const& range1, Range2 const& range2) { + is_permutation(ForwardRange1 const& range1, ForwardRange2 const& range2) { return sprout::is_permutation(sprout::begin(range1), sprout::end(range1), sprout::begin(range2)); } - template + template inline SPROUT_CONSTEXPR bool - is_permutation(Range1 const& range1, Range2 const& range2, BinaryPredicate pred) { + is_permutation(ForwardRange1 const& range1, ForwardRange2 const& range2, BinaryPredicate pred) { return sprout::is_permutation(sprout::begin(range1), sprout::end(range1), sprout::begin(range2), pred); } } // namespace range diff --git a/sprout/range/algorithm/is_sorted.hpp b/sprout/range/algorithm/is_sorted.hpp index bcd95b64..4b5cbad2 100644 --- a/sprout/range/algorithm/is_sorted.hpp +++ b/sprout/range/algorithm/is_sorted.hpp @@ -10,15 +10,15 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.4.1.5 is_sorted - template + template inline SPROUT_CONSTEXPR bool - is_sorted(Range const& range) { + is_sorted(ForwardRange const& range) { return sprout::is_sorted(sprout::begin(range), sprout::end(range)); } - template + template inline SPROUT_CONSTEXPR bool - is_sorted(Range const& range, Compare comp) { + is_sorted(ForwardRange const& range, Compare comp) { return sprout::is_sorted(sprout::begin(range), sprout::end(range), comp); } } // namespace range diff --git a/sprout/range/algorithm/is_sorted_until.hpp b/sprout/range/algorithm/is_sorted_until.hpp index af93a351..cebd67b5 100644 --- a/sprout/range/algorithm/is_sorted_until.hpp +++ b/sprout/range/algorithm/is_sorted_until.hpp @@ -12,53 +12,53 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.4.1.5 is_sorted - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - is_sorted_until(Range&& range) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + is_sorted_until(ForwardRange&& range) { + return sprout::range::range_return::pack( sprout::is_sorted_until( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)) + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)) ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - is_sorted_until(Range&& range, Compare comp) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + is_sorted_until(ForwardRange&& range, Compare comp) { + return sprout::range::range_return::pack( sprout::is_sorted_until( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), comp ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - is_sorted_until(Range&& range) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + is_sorted_until(ForwardRange&& range) { + return sprout::range::range_return::pack( sprout::is_sorted_until( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)) + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)) ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - is_sorted_until(Range&& range, Compare comp) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + is_sorted_until(ForwardRange&& range, Compare comp) { + return sprout::range::range_return::pack( sprout::is_sorted_until( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), comp ), - sprout::forward(range) + sprout::forward(range) ); } } // namespace range diff --git a/sprout/range/algorithm/is_strictly_decreasing.hpp b/sprout/range/algorithm/is_strictly_decreasing.hpp index e03b6d37..95954cef 100644 --- a/sprout/range/algorithm/is_strictly_decreasing.hpp +++ b/sprout/range/algorithm/is_strictly_decreasing.hpp @@ -10,9 +10,9 @@ namespace sprout { // // is_strictly_decreasing // - template + template inline SPROUT_CONSTEXPR bool - is_strictly_decreasing(Range const& range) { + is_strictly_decreasing(ForwardRange const& range) { return sprout::is_strictly_decreasing(sprout::begin(range), sprout::end(range)); } } // namespace range diff --git a/sprout/range/algorithm/is_strictly_increasing.hpp b/sprout/range/algorithm/is_strictly_increasing.hpp index 8cb1438c..3b912589 100644 --- a/sprout/range/algorithm/is_strictly_increasing.hpp +++ b/sprout/range/algorithm/is_strictly_increasing.hpp @@ -10,9 +10,9 @@ namespace sprout { // // is_strictly_increasing // - template + template inline SPROUT_CONSTEXPR bool - is_strictly_increasing(Range const& range) { + is_strictly_increasing(ForwardRange const& range) { return sprout::is_strictly_increasing(sprout::begin(range), sprout::end(range)); } } // namespace range diff --git a/sprout/range/algorithm/lexicographical_compare.hpp b/sprout/range/algorithm/lexicographical_compare.hpp index dec26688..e703b378 100644 --- a/sprout/range/algorithm/lexicographical_compare.hpp +++ b/sprout/range/algorithm/lexicographical_compare.hpp @@ -10,17 +10,17 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.4.8 Lexicographical comparison - template + template inline SPROUT_CONSTEXPR bool - lexicographical_compare(Range1 const& range1, Range2 const& range2) { + lexicographical_compare(InputRange1 const& range1, InputRange2 const& range2) { return sprout::lexicographical_compare( sprout::begin(range1), sprout::end(range1), sprout::begin(range2), sprout::end(range2) ); } - template + template inline SPROUT_CONSTEXPR bool - lexicographical_compare(Range1 const& range1, Range2 const& range2, Compare comp) { + lexicographical_compare(InputRange1 const& range1, InputRange2 const& range2, Compare comp) { return sprout::lexicographical_compare( sprout::begin(range1), sprout::end(range1), sprout::begin(range2), sprout::end(range2), comp ); diff --git a/sprout/range/algorithm/lower_bound.hpp b/sprout/range/algorithm/lower_bound.hpp index 975d6673..70e6f6d9 100644 --- a/sprout/range/algorithm/lower_bound.hpp +++ b/sprout/range/algorithm/lower_bound.hpp @@ -12,57 +12,57 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.4.3.1 lower_bound - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - lower_bound(Range&& range, T const& value) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + lower_bound(ForwardRange&& range, T const& value) { + return sprout::range::range_return::pack( sprout::lower_bound( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), value ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - lower_bound(Range&& range, T const& value, Compare comp) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + lower_bound(ForwardRange&& range, T const& value, Compare comp) { + return sprout::range::range_return::pack( sprout::lower_bound( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), value, comp ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - lower_bound(Range&& range, T const& value) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + lower_bound(ForwardRange&& range, T const& value) { + return sprout::range::range_return::pack( sprout::lower_bound( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), value ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - lower_bound(Range&& range, T const& value, Compare comp) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + lower_bound(ForwardRange&& range, T const& value, Compare comp) { + return sprout::range::range_return::pack( sprout::lower_bound( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), value, comp ), - sprout::forward(range) + sprout::forward(range) ); } } // namespace range diff --git a/sprout/range/algorithm/max_element.hpp b/sprout/range/algorithm/max_element.hpp index ead5dd9a..6b46b78c 100644 --- a/sprout/range/algorithm/max_element.hpp +++ b/sprout/range/algorithm/max_element.hpp @@ -12,53 +12,53 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.4.7 Minimum and maximum - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - max_element(Range&& range) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + max_element(ForwardRange&& range) { + return sprout::range::range_return::pack( sprout::max_element( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)) + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)) ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - max_element(Range&& range, Compare comp) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + max_element(ForwardRange&& range, Compare comp) { + return sprout::range::range_return::pack( sprout::max_element( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), comp ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - max_element(Range&& range) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + max_element(ForwardRange&& range) { + return sprout::range::range_return::pack( sprout::max_element( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)) + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)) ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - max_element(Range&& range, Compare comp) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + max_element(ForwardRange&& range, Compare comp) { + return sprout::range::range_return::pack( sprout::max_element( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), comp ), - sprout::forward(range) + sprout::forward(range) ); } } // namespace range diff --git a/sprout/range/algorithm/min_element.hpp b/sprout/range/algorithm/min_element.hpp index 0ef0b8b0..75ae62a8 100644 --- a/sprout/range/algorithm/min_element.hpp +++ b/sprout/range/algorithm/min_element.hpp @@ -12,53 +12,53 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.4.7 Minimum and maximum - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - min_element(Range&& range) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + min_element(ForwardRange&& range) { + return sprout::range::range_return::pack( sprout::min_element( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)) + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)) ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - min_element(Range&& range, Compare comp) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + min_element(ForwardRange&& range, Compare comp) { + return sprout::range::range_return::pack( sprout::min_element( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), comp ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - min_element(Range&& range) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + min_element(ForwardRange&& range) { + return sprout::range::range_return::pack( sprout::min_element( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)) + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)) ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - min_element(Range&& range, Compare comp) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + min_element(ForwardRange&& range, Compare comp) { + return sprout::range::range_return::pack( sprout::min_element( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), comp ), - sprout::forward(range) + sprout::forward(range) ); } } // namespace range diff --git a/sprout/range/algorithm/minmax_element.hpp b/sprout/range/algorithm/minmax_element.hpp index 5a79e678..02ef10f6 100644 --- a/sprout/range/algorithm/minmax_element.hpp +++ b/sprout/range/algorithm/minmax_element.hpp @@ -11,27 +11,27 @@ namespace sprout { namespace range { namespace detail { - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::range_return::type, - typename sprout::range::range_return::type + typename sprout::range::range_return::type, + typename sprout::range::range_return::type > - pack_pair(Pair const& pair, Range&& range) { + pack_pair(Pair const& pair, ForwardRange&& range) { return { - sprout::range::range_return::pack(pair.first, sprout::forward(range)), - sprout::range::range_return::pack(pair.second, sprout::forward(range)) + sprout::range::range_return::pack(pair.first, sprout::forward(range)), + sprout::range::range_return::pack(pair.second, sprout::forward(range)) }; } - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::range_return::type, - typename sprout::range::range_return::type + typename sprout::range::range_return::type, + typename sprout::range::range_return::type > - pack_pair(Pair const& pair, Range&& range) { + pack_pair(Pair const& pair, ForwardRange&& range) { return { - sprout::range::range_return::pack(pair.first, sprout::forward(range)), - sprout::range::range_return::pack(pair.second, sprout::forward(range)) + sprout::range::range_return::pack(pair.first, sprout::forward(range)), + sprout::range::range_return::pack(pair.second, sprout::forward(range)) }; } } // namespace detail @@ -39,65 +39,65 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.4.7 Minimum and maximum - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::range_return::type, - typename sprout::range::range_return::type + typename sprout::range::range_return::type, + typename sprout::range::range_return::type > - minmax_element(Range&& range) { - return sprout::range::detail::pack_pair( + minmax_element(ForwardRange&& range) { + return sprout::range::detail::pack_pair( sprout::minmax_element( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)) + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)) ), - sprout::forward(range) + sprout::forward(range) ); } - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::range_return::type, - typename sprout::range::range_return::type + typename sprout::range::range_return::type, + typename sprout::range::range_return::type > - minmax_element(Range&& range, Compare comp) { - return sprout::range::detail::pack_pair( + minmax_element(ForwardRange&& range, Compare comp) { + return sprout::range::detail::pack_pair( sprout::minmax_element( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), comp ), - sprout::forward(range) + sprout::forward(range) ); } - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::range_return::type, - typename sprout::range::range_return::type + typename sprout::range::range_return::type, + typename sprout::range::range_return::type > - minmax_element(Range&& range) { - return sprout::range::detail::pack_pair( + minmax_element(ForwardRange&& range) { + return sprout::range::detail::pack_pair( sprout::minmax_element( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)) + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)) ), - sprout::forward(range) + sprout::forward(range) ); } - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::range_return::type, - typename sprout::range::range_return::type + typename sprout::range::range_return::type, + typename sprout::range::range_return::type > - minmax_element(Range&& range, Compare comp) { - return sprout::range::detail::pack_pair( + minmax_element(ForwardRange&& range, Compare comp) { + return sprout::range::detail::pack_pair( sprout::minmax_element( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), comp ), - sprout::forward(range) + sprout::forward(range) ); } } // namespace range diff --git a/sprout/range/algorithm/mismatch.hpp b/sprout/range/algorithm/mismatch.hpp index 2ec7476b..617a6b52 100644 --- a/sprout/range/algorithm/mismatch.hpp +++ b/sprout/range/algorithm/mismatch.hpp @@ -13,29 +13,29 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.2.10 Mismatch - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::lvalue_iterator::type, - typename sprout::range::lvalue_iterator::type + typename sprout::range::lvalue_iterator::type, + typename sprout::range::lvalue_iterator::type > - mismatch(Range1&& range1, Range2&& range2) { + mismatch(InputRange1&& range1, InputRange2&& range2) { return sprout::mismatch( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)) + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)) ); } - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::lvalue_iterator::type, - typename sprout::range::lvalue_iterator::type + typename sprout::range::lvalue_iterator::type, + typename sprout::range::lvalue_iterator::type > - mismatch(Range1&& range1, Range2&& range2, BinaryPredicate pred) { + mismatch(InputRange1&& range1, InputRange2&& range2, BinaryPredicate pred) { return sprout::mismatch( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), pred ); } diff --git a/sprout/range/algorithm/next_difference.hpp b/sprout/range/algorithm/next_difference.hpp index 8fbf9342..2e166ede 100644 --- a/sprout/range/algorithm/next_difference.hpp +++ b/sprout/range/algorithm/next_difference.hpp @@ -13,32 +13,32 @@ namespace sprout { // // next_difference // - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::lvalue_iterator::type, - typename sprout::range::lvalue_iterator::type + typename sprout::range::lvalue_iterator::type, + typename sprout::range::lvalue_iterator::type > - next_difference(Range1&& range1, Range2&& range2, Compare comp) { + next_difference(InputRange1&& range1, InputRange2&& range2, Compare comp) { return sprout::next_difference( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)), + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)), comp ); } - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::lvalue_iterator::type, - typename sprout::range::lvalue_iterator::type + typename sprout::range::lvalue_iterator::type, + typename sprout::range::lvalue_iterator::type > - next_difference(Range1&& range1, Range2&& range2) { + next_difference(InputRange1&& range1, InputRange2&& range2) { return sprout::next_difference( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)) + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)) ); } } // namespace range diff --git a/sprout/range/algorithm/next_intersection.hpp b/sprout/range/algorithm/next_intersection.hpp index 767edead..5dbc184a 100644 --- a/sprout/range/algorithm/next_intersection.hpp +++ b/sprout/range/algorithm/next_intersection.hpp @@ -13,32 +13,32 @@ namespace sprout { // // next_intersection // - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::lvalue_iterator::type, - typename sprout::range::lvalue_iterator::type + typename sprout::range::lvalue_iterator::type, + typename sprout::range::lvalue_iterator::type > - next_intersection(Range1&& range1, Range2&& range2, Compare comp) { + next_intersection(InputRange1&& range1, InputRange2&& range2, Compare comp) { return sprout::next_intersection( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)), + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)), comp ); } - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::lvalue_iterator::type, - typename sprout::range::lvalue_iterator::type + typename sprout::range::lvalue_iterator::type, + typename sprout::range::lvalue_iterator::type > - next_intersection(Range1&& range1, Range2&& range2) { + next_intersection(InputRange1&& range1, InputRange2&& range2) { return sprout::next_intersection( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)) + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)) ); } } // namespace range diff --git a/sprout/range/algorithm/next_union.hpp b/sprout/range/algorithm/next_union.hpp index a99dd004..0954cdce 100644 --- a/sprout/range/algorithm/next_union.hpp +++ b/sprout/range/algorithm/next_union.hpp @@ -13,32 +13,32 @@ namespace sprout { // // next_union // - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::lvalue_iterator::type, - typename sprout::range::lvalue_iterator::type + typename sprout::range::lvalue_iterator::type, + typename sprout::range::lvalue_iterator::type > - next_union(Range1&& range1, Range2&& range2, Compare comp) { + next_union(InputRange1&& range1, InputRange2&& range2, Compare comp) { return sprout::next_union( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)), + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)), comp ); } - template + template inline SPROUT_CONSTEXPR sprout::pair< - typename sprout::range::lvalue_iterator::type, - typename sprout::range::lvalue_iterator::type + typename sprout::range::lvalue_iterator::type, + typename sprout::range::lvalue_iterator::type > - next_union(Range1&& range1, Range2&& range2) { + next_union(InputRange1&& range1, InputRange2&& range2) { return sprout::next_union( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)) + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)) ); } } // namespace range diff --git a/sprout/range/algorithm/none_of.hpp b/sprout/range/algorithm/none_of.hpp index 67ffa390..693599df 100644 --- a/sprout/range/algorithm/none_of.hpp +++ b/sprout/range/algorithm/none_of.hpp @@ -10,9 +10,9 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.2.3 None of - template + template inline SPROUT_CONSTEXPR bool - none_of(Range const& range, Predicate pred) { + none_of(InputRange const& range, Predicate pred) { return sprout::none_of(sprout::begin(range), sprout::end(range), pred); } } // namespace range diff --git a/sprout/range/algorithm/none_of_equal.hpp b/sprout/range/algorithm/none_of_equal.hpp index bac4b847..7117f7b7 100644 --- a/sprout/range/algorithm/none_of_equal.hpp +++ b/sprout/range/algorithm/none_of_equal.hpp @@ -10,9 +10,9 @@ namespace sprout { // // none_of_equal // - template + template inline SPROUT_CONSTEXPR bool - none_of_equal(Range const& range, T const& value) { + none_of_equal(InputRange const& range, T const& value) { return sprout::none_of_equal(sprout::begin(range), sprout::end(range), value); } } // namespace range diff --git a/sprout/range/algorithm/one_of.hpp b/sprout/range/algorithm/one_of.hpp index 68f602ad..65af08db 100644 --- a/sprout/range/algorithm/one_of.hpp +++ b/sprout/range/algorithm/one_of.hpp @@ -10,9 +10,9 @@ namespace sprout { // // one_of // - template + template inline SPROUT_CONSTEXPR bool - one_of(Range const& range, Predicate pred) { + one_of(InputRange const& range, Predicate pred) { return sprout::one_of(sprout::begin(range), sprout::end(range), pred); } } // namespace range diff --git a/sprout/range/algorithm/one_of_equal.hpp b/sprout/range/algorithm/one_of_equal.hpp index e206c972..f4739acd 100644 --- a/sprout/range/algorithm/one_of_equal.hpp +++ b/sprout/range/algorithm/one_of_equal.hpp @@ -10,9 +10,9 @@ namespace sprout { // // one_of_equal // - template + template inline SPROUT_CONSTEXPR bool - one_of_equal(Range const& range, T const& value) { + one_of_equal(InputRange const& range, T const& value) { return sprout::one_of_equal(sprout::begin(range), sprout::end(range), value); } } // namespace range diff --git a/sprout/range/algorithm/partition_point.hpp b/sprout/range/algorithm/partition_point.hpp index 3767ee75..06b33c3a 100644 --- a/sprout/range/algorithm/partition_point.hpp +++ b/sprout/range/algorithm/partition_point.hpp @@ -12,16 +12,16 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.3.13 partitions - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - partition_point(Range&& range, Predicate pred) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + partition_point(ForwardRange&& range, Predicate pred) { + return sprout::range::range_return::pack( sprout::partition_point( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), pred ), - sprout::forward(range) + sprout::forward(range) ); } } // namespace range diff --git a/sprout/range/algorithm/search.hpp b/sprout/range/algorithm/search.hpp index a1a9b087..64f70596 100644 --- a/sprout/range/algorithm/search.hpp +++ b/sprout/range/algorithm/search.hpp @@ -12,61 +12,61 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.2.13 Search - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - search(Range1&& range1, Range2&& range2) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + search(ForwardRange1&& range1, ForwardRange2&& range2) { + return sprout::range::range_return::pack( sprout::search( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)) + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)) ), - sprout::forward(range1) + sprout::forward(range1) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - search(Range1&& range1, Range2&& range2, BinaryPredicate pred) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + search(ForwardRange1&& range1, ForwardRange2&& range2, BinaryPredicate pred) { + return sprout::range::range_return::pack( sprout::search( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)), + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)), pred ), - sprout::forward(range1) + sprout::forward(range1) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - search(Range1&& range1, Range2&& range2) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + search(ForwardRange1&& range1, ForwardRange2&& range2) { + return sprout::range::range_return::pack( sprout::search( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)) + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)) ), - sprout::forward(range1) + sprout::forward(range1) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - search(Range1&& range1, Range2&& range2, BinaryPredicate pred) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + search(ForwardRange1&& range1, ForwardRange2&& range2, BinaryPredicate pred) { + return sprout::range::range_return::pack( sprout::search( - sprout::begin(sprout::forward(range1)), - sprout::end(sprout::forward(range1)), - sprout::begin(sprout::forward(range2)), - sprout::end(sprout::forward(range2)), + sprout::begin(sprout::forward(range1)), + sprout::end(sprout::forward(range1)), + sprout::begin(sprout::forward(range2)), + sprout::end(sprout::forward(range2)), pred ), - sprout::forward(range1) + sprout::forward(range1) ); } } // namespace range diff --git a/sprout/range/algorithm/search_n.hpp b/sprout/range/algorithm/search_n.hpp index 3b5f5257..ba45f0b9 100644 --- a/sprout/range/algorithm/search_n.hpp +++ b/sprout/range/algorithm/search_n.hpp @@ -12,61 +12,61 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.2.13 Search - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - search_n(Range&& range, Size count, T const& value) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + search_n(ForwardRange&& range, Size count, T const& value) { + return sprout::range::range_return::pack( sprout::search_n( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), count, value ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - search_n(Range&& range, Size count, T const& value, BinaryPredicate pred) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + search_n(ForwardRange&& range, Size count, T const& value, BinaryPredicate pred) { + return sprout::range::range_return::pack( sprout::search_n( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), count, value, pred ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - search_n(Range&& range, Size count, T const& value) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + search_n(ForwardRange&& range, Size count, T const& value) { + return sprout::range::range_return::pack( sprout::search_n( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), count, value ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - search_n(Range&& range, Size count, T const& value, BinaryPredicate pred) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + search_n(ForwardRange&& range, Size count, T const& value, BinaryPredicate pred) { + return sprout::range::range_return::pack( sprout::search_n( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), count, value, pred ), - sprout::forward(range) + sprout::forward(range) ); } } // namespace range diff --git a/sprout/range/algorithm/tristate_lexicographical_compare.hpp b/sprout/range/algorithm/tristate_lexicographical_compare.hpp index 825eccd2..b9c99f24 100644 --- a/sprout/range/algorithm/tristate_lexicographical_compare.hpp +++ b/sprout/range/algorithm/tristate_lexicographical_compare.hpp @@ -10,33 +10,33 @@ namespace sprout { // // tristate_lexicographical_compare // - template + template inline SPROUT_CONSTEXPR int - tristate_lexicographical_compare(Range1 const& range1, Range2 const& range2) { + tristate_lexicographical_compare(InputRange1 const& range1, InputRange2 const& range2) { return sprout::tristate_lexicographical_compare( sprout::begin(range1), sprout::end(range1), sprout::begin(range2), sprout::end(range2) ); } - template + template inline SPROUT_CONSTEXPR int - tristate_lexicographical_compare(Range1 const& range1, Range2 const& range2, Compare comp) { + tristate_lexicographical_compare(InputRange1 const& range1, InputRange2 const& range2, Compare comp) { return sprout::tristate_lexicographical_compare( sprout::begin(range1), sprout::end(range1), sprout::begin(range2), sprout::end(range2), comp ); } - template + template inline SPROUT_CONSTEXPR int - tristate_lexicographical_compare(Range1 const& range1, T1 const& delim1, Range2 const& range2, T2 const& delim2) { + tristate_lexicographical_compare(InputRange1 const& range1, T1 const& delim1, InputRange2 const& range2, T2 const& delim2) { return sprout::tristate_lexicographical_compare( sprout::begin(range1), sprout::end(range1), delim1, sprout::begin(range2), sprout::end(range2), delim2 ); } - template + template inline SPROUT_CONSTEXPR int - tristate_lexicographical_compare(Range1 const& range1, T1 const& delim1, Range2 const& range2, T2 const& delim2, Compare comp) { + tristate_lexicographical_compare(InputRange1 const& range1, T1 const& delim1, InputRange2 const& range2, T2 const& delim2, Compare comp) { return sprout::tristate_lexicographical_compare( sprout::begin(range1), sprout::end(range1), delim1, sprout::begin(range2), sprout::end(range2), delim2, comp ); diff --git a/sprout/range/algorithm/upper_bound.hpp b/sprout/range/algorithm/upper_bound.hpp index eea8d289..0827fc12 100644 --- a/sprout/range/algorithm/upper_bound.hpp +++ b/sprout/range/algorithm/upper_bound.hpp @@ -12,57 +12,57 @@ namespace sprout { // Copyright (C) 2011 RiSK (sscrisk) // 25.4.3.2 upper_bound - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - upper_bound(Range&& range, T const& value) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + upper_bound(ForwardRange&& range, T const& value) { + return sprout::range::range_return::pack( sprout::upper_bound( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), value ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - upper_bound(Range&& range, T const& value, Compare comp) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + upper_bound(ForwardRange&& range, T const& value, Compare comp) { + return sprout::range::range_return::pack( sprout::upper_bound( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), value, comp ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - upper_bound(Range&& range, T const& value) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + upper_bound(ForwardRange&& range, T const& value) { + return sprout::range::range_return::pack( sprout::upper_bound( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), value ), - sprout::forward(range) + sprout::forward(range) ); } - template - inline SPROUT_CONSTEXPR typename sprout::range::range_return::type - upper_bound(Range&& range, T const& value, Compare comp) { - return sprout::range::range_return::pack( + template + inline SPROUT_CONSTEXPR typename sprout::range::range_return::type + upper_bound(ForwardRange&& range, T const& value, Compare comp) { + return sprout::range::range_return::pack( sprout::upper_bound( - sprout::begin(sprout::forward(range)), - sprout::end(sprout::forward(range)), + sprout::begin(sprout::forward(range)), + sprout::end(sprout::forward(range)), value, comp ), - sprout::forward(range) + sprout::forward(range) ); } } // namespace range diff --git a/sprout/range/numeric/accumulate.hpp b/sprout/range/numeric/accumulate.hpp index a9c6719c..4bfb5e98 100644 --- a/sprout/range/numeric/accumulate.hpp +++ b/sprout/range/numeric/accumulate.hpp @@ -7,15 +7,15 @@ namespace sprout { namespace range { // 26.7.2 Accumulate - template + template inline SPROUT_CONSTEXPR T - accumulate(Range const& range, T init, BinaryOperation binary_op) { + accumulate(InputRange const& range, T init, BinaryOperation binary_op) { return sprout::accumulate(sprout::begin(range), sprout::end(range), init, binary_op); } - template + template inline SPROUT_CONSTEXPR T - accumulate(Range const& range, T init) { + accumulate(InputRange const& range, T init) { return sprout::accumulate(sprout::begin(range), sprout::end(range), init); } } // namespace range diff --git a/sprout/range/numeric/inner_product.hpp b/sprout/range/numeric/inner_product.hpp index 3809e775..60a86d99 100644 --- a/sprout/range/numeric/inner_product.hpp +++ b/sprout/range/numeric/inner_product.hpp @@ -7,19 +7,19 @@ namespace sprout { namespace range { // 26.7.3 Inner product - template + template inline SPROUT_CONSTEXPR T inner_product( - Range1 const& range1, Range2 const& range2, T init, + InputRange1 const& range1, InputRange2 const& range2, T init, BinaryOperation1 binary_op1, BinaryOperation2 binary_op2 ) { return sprout::inner_product(sprout::begin(range1), sprout::end(range1), sprout::begin(range2), init, binary_op1, binary_op2); } - template + template inline SPROUT_CONSTEXPR T - inner_product(Range1 const& range1, Range2 const& range2, T init) { + inner_product(InputRange1 const& range1, InputRange2 const& range2, T init) { return sprout::inner_product(sprout::begin(range1), sprout::end(range1), sprout::begin(range2), init); } } // namespace range diff --git a/sprout/uuid/string_generator.hpp b/sprout/uuid/string_generator.hpp index 00aaca78..2172ff8a 100644 --- a/sprout/uuid/string_generator.hpp +++ b/sprout/uuid/string_generator.hpp @@ -21,16 +21,16 @@ namespace sprout { public: typedef sprout::uuids::uuid result_type; private: - template + template struct next_char { public: - typedef typename std::iterator_traits::value_type char_type; + typedef typename std::iterator_traits::value_type char_type; public: char_type c; - Iterator first; - Iterator last; + ForwardIterator first; + ForwardIterator last; public: - SPROUT_CONSTEXPR next_char(Iterator f, Iterator l) + SPROUT_CONSTEXPR next_char(ForwardIterator f, ForwardIterator l) : c(f != l ? *f : throw std::runtime_error("string_generator: invalid uuid string (out of range)") @@ -98,22 +98,22 @@ namespace sprout { static SPROUT_CONSTEXPR bool is_close_brace(char32_t c, char open_brace) { return open_brace == U'{' && c == U'}'; } - template + template SPROUT_CONSTEXPR result_type - generate_2_3(next_char nc, Char open_brace, bool has_dashes, std::uint8_t byte, Args... args) const { + generate_2_3(next_char nc, Char open_brace, bool has_dashes, std::uint8_t byte, Args... args) const { return generate_2(nc, open_brace, has_dashes, args..., static_cast((byte << 4) | get_value(nc.c))); } - template + template SPROUT_CONSTEXPR result_type - generate_2_2(next_char nc, Char open_brace, bool has_dashes, Args... args) const { + generate_2_2(next_char nc, Char open_brace, bool has_dashes, Args... args) const { return generate_2_3(nc.next(), open_brace, has_dashes, get_value(nc.c), args...); } - template + template SPROUT_CONSTEXPR typename std::enable_if< sizeof...(Args) == 6 || sizeof...(Args) == 8 || sizeof...(Args) == 10, result_type >::type - generate_2_1(next_char nc, Char open_brace, bool has_dashes, Args... args) const { + generate_2_1(next_char nc, Char open_brace, bool has_dashes, Args... args) const { return has_dashes ? is_dash(nc.c) ? generate_2_2(nc.next(), open_brace, has_dashes, args...) @@ -121,64 +121,64 @@ namespace sprout { : generate_2_2(nc, open_brace, has_dashes, args...) ; } - template + template SPROUT_CONSTEXPR typename std::enable_if< sizeof...(Args) == 4, result_type >::type - generate_2_1(next_char nc, Char open_brace, bool, Args... args) const { + generate_2_1(next_char nc, Char open_brace, bool, Args... args) const { return is_dash(nc.c) ? generate_2_2(nc.next(), open_brace, true, args...) : generate_2_2(nc, open_brace, false, args...) ; } - template + template SPROUT_CONSTEXPR typename std::enable_if< sizeof...(Args) != 4 && sizeof...(Args) != 6 && sizeof...(Args) != 8 && sizeof...(Args) != 10, result_type >::type - generate_2_1(next_char nc, Char open_brace, bool has_dashes, Args... args) const { + generate_2_1(next_char nc, Char open_brace, bool has_dashes, Args... args) const { return generate_2_2(nc, open_brace, has_dashes, args...); } - template + template SPROUT_CONSTEXPR typename std::enable_if< sizeof...(Args) == 16, result_type >::type - generate_2(next_char nc, Char open_brace, bool, Args... args) const { + generate_2(next_char nc, Char open_brace, bool, Args... args) const { return !open_brace || (open_brace && is_close_brace(nc.next().c, open_brace)) ? result_type{{args...}} : throw std::runtime_error("string_generator: invalid uuid string (brace not closed)") ; } - template + template SPROUT_CONSTEXPR typename std::enable_if< sizeof...(Args) == 0, result_type >::type - generate_2(next_char nc, Char open_brace, bool has_dashes, Args... args) const { + generate_2(next_char nc, Char open_brace, bool has_dashes, Args... args) const { return generate_2_2(nc, open_brace, has_dashes, args...); } - template + template SPROUT_CONSTEXPR typename std::enable_if< sizeof...(Args) != 0 && sizeof...(Args) != 16, result_type >::type - generate_2(next_char nc, Char open_brace, bool has_dashes, Args... args) const { + generate_2(next_char nc, Char open_brace, bool has_dashes, Args... args) const { return generate_2_1(nc.next(), open_brace, has_dashes, args...); } - template + template SPROUT_CONSTEXPR result_type - generate_1(next_char nc) const { + generate_1(next_char nc) const { return is_open_brace(nc.c) ? generate_2(nc.next(), nc.c, false) - : generate_2(nc, typename next_char::char_type(), false) + : generate_2(nc, typename next_char::char_type(), false) ; } public: - template - SPROUT_CONSTEXPR result_type operator()(Iterator first, Iterator last) const { - return generate_1(next_char(first, last)); + template + SPROUT_CONSTEXPR result_type operator()(ForwardIterator first, ForwardIterator last) const { + return generate_1(next_char(first, last)); } template SPROUT_CONSTEXPR result_type operator()(sprout::basic_string const& s) const { @@ -201,9 +201,9 @@ namespace sprout { // // make_uuid // - template + template inline SPROUT_CONSTEXPR sprout::uuids::uuid - make_uuid(Iterator first, Iterator last) { + make_uuid(ForwardIterator first, ForwardIterator last) { return sprout::uuids::string_generator()(first, last); } template diff --git a/sprout/uuid/udl.hpp b/sprout/uuid/udl.hpp index b91c801c..c5589446 100644 --- a/sprout/uuid/udl.hpp +++ b/sprout/uuid/udl.hpp @@ -116,10 +116,10 @@ namespace sprout { return sprout::to_string(U"x500"); } - template + template inline SPROUT_CONSTEXPR sprout::uuids::md5_name_generator - uuid3_impl(Range const& rng) { - typedef typename std::decay::type>::type value_type; + uuid3_impl(InputRange const& rng) { + typedef typename std::decay::type>::type value_type; typedef sprout::ctypes::nocase_equal_to predicate_type; return sprout::range::equal(rng, sprout::uuids::detail::dns_token(), predicate_type()) ? sprout::uuids::make_uuid3_dns() : sprout::range::equal(rng, sprout::uuids::detail::url_token(), predicate_type()) ? sprout::uuids::make_uuid3_url() @@ -129,10 +129,10 @@ namespace sprout { ; } - template + template inline SPROUT_CONSTEXPR sprout::uuids::sha1_name_generator - uuid5_impl(Range const& rng) { - typedef typename std::decay::type>::type value_type; + uuid5_impl(InputRange const& rng) { + typedef typename std::decay::type>::type value_type; typedef sprout::ctypes::nocase_equal_to predicate_type; return sprout::range::equal(rng, sprout::uuids::detail::dns_token(), predicate_type()) ? sprout::uuids::make_uuid5_dns() : sprout::range::equal(rng, sprout::uuids::detail::url_token(), predicate_type()) ? sprout::uuids::make_uuid5_url() diff --git a/testspr/algorithm.hpp b/testspr/algorithm.hpp index 75a6ac7f..1f506e0d 100644 --- a/testspr/algorithm.hpp +++ b/testspr/algorithm.hpp @@ -29,9 +29,9 @@ namespace testspr { : testspr::equal(first1 + 1, last1, first2 + 1, last2) ; } - template + template inline SPROUT_CONSTEXPR bool - equal(Range1 const& range1, Range2 const& range2) { + equal(InputRange1 const& range1, InputRange2 const& range2) { return testspr::equal(sprout::begin(range1), sprout::end(range1), sprout::begin(range2), sprout::end(range2)); } @@ -46,9 +46,9 @@ namespace testspr { : testspr::is_found(first + 1, last, value) ; } - template + template inline SPROUT_CONSTEXPR bool - is_found(Range const& range, T const& value) { + is_found(InputRange const& range, T const& value) { return testspr::is_found(sprout::begin(range), sprout::end(range), value); } @@ -62,9 +62,9 @@ namespace testspr { : (*first == value ? 1 : 0) + testspr::count(first + 1, last, value) ; } - template - inline SPROUT_CONSTEXPR typename std::iterator_traits::difference_type - count(Range const& range, T const& value) { + template + inline SPROUT_CONSTEXPR typename std::iterator_traits::difference_type + count(InputRange const& range, T const& value) { return testspr::count(sprout::begin(range), sprout::end(range), value); } @@ -96,9 +96,9 @@ namespace testspr { { return testspr::detail::is_permutation_impl(first1, last1, first2, last2, first1, first2); } - template + template inline SPROUT_CONSTEXPR bool - is_permutation(Range1 const& range1, Range2 const& range2) { + is_permutation(ForwardRange1 const& range1, ForwardRange2 const& range2) { return testspr::is_permutation( sprout::begin(range1), sprout::end(range1), sprout::begin(range2), sprout::end(range2) diff --git a/testspr/print.hpp b/testspr/print.hpp index 5fde4a82..a8095d3b 100644 --- a/testspr/print.hpp +++ b/testspr/print.hpp @@ -12,13 +12,13 @@ namespace testspr { // // print // - template - void print(Iterator first, Iterator last) { - std::for_each(first, last, [](typename std::iterator_traits::value_type const& e){ std::cout << e << ' '; }); + template + void print(InputIterator first, InputIterator last) { + std::for_each(first, last, [](typename std::iterator_traits::value_type const& e){ std::cout << e << ' '; }); std::cout << std::endl; } - template - void print(Range const& range) { + template + void print(InputRange const& range) { testspr::print(sprout::begin(range), sprout::end(range)); }