mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-01-23 20:46:37 +00:00
fix template-parameter name: Iterator, Range
This commit is contained in:
parent
ddccff51e6
commit
21cefe8a67
62 changed files with 809 additions and 784 deletions
|
@ -33,20 +33,20 @@ namespace sprout {
|
|||
Compare comp
|
||||
);
|
||||
|
||||
template<typename Container, typename Iterator>
|
||||
template<typename Container, typename RandomAccessIterator>
|
||||
inline SPROUT_CONSTEXPR typename sprout::container_traits<Container>::value_type const&
|
||||
sort_select_pivot(
|
||||
Iterator origin,
|
||||
RandomAccessIterator origin,
|
||||
typename sprout::container_traits<Container>::difference_type start,
|
||||
typename sprout::container_traits<Container>::difference_type end
|
||||
)
|
||||
{ // pivot ‚ð‘I‚Ô<E2809A>i’†‰›‚Ì—v‘f<E28098>j
|
||||
return *sprout::next(origin, (end + start) / 2);
|
||||
}
|
||||
template<typename Container, typename Iterator, typename Compare>
|
||||
template<typename Container, typename RandomAccessIterator, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::container_traits<Container>::difference_type
|
||||
sort_find_l(
|
||||
Iterator origin,
|
||||
RandomAccessIterator origin,
|
||||
Compare comp,
|
||||
typename sprout::container_traits<Container>::difference_type l,
|
||||
typename sprout::container_traits<Container>::value_type const& p
|
||||
|
@ -57,10 +57,10 @@ namespace sprout {
|
|||
: l
|
||||
;
|
||||
}
|
||||
template<typename Container, typename Iterator, typename Compare>
|
||||
template<typename Container, typename RandomAccessIterator, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::container_traits<Container>::difference_type
|
||||
sort_find_r(
|
||||
Iterator origin,
|
||||
RandomAccessIterator origin,
|
||||
Compare comp,
|
||||
typename sprout::container_traits<Container>::difference_type r,
|
||||
typename sprout::container_traits<Container>::value_type const& p
|
||||
|
|
|
@ -23,9 +23,14 @@ namespace sprout {
|
|||
true
|
||||
);
|
||||
}
|
||||
template<typename Result, typename Container, typename Compare, typename Iterator>
|
||||
template<typename Result, typename Container, typename Compare, typename BidirectionalIterator>
|
||||
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<Result>(
|
||||
cont, comp, first, last,
|
||||
i, ii, sprout::prev(j)
|
||||
|
@ -36,9 +41,14 @@ namespace sprout {
|
|||
)
|
||||
;
|
||||
}
|
||||
template<typename Result, typename Container, typename Compare, typename Iterator>
|
||||
template<typename Result, typename Container, typename Compare, typename BidirectionalIterator>
|
||||
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<Result>(
|
||||
cont, comp, first, last,
|
||||
i, ii, last
|
||||
|
@ -50,9 +60,9 @@ namespace sprout {
|
|||
)
|
||||
;
|
||||
}
|
||||
template<typename Result, typename Container, typename Compare, typename Iterator>
|
||||
template<typename Result, typename Container, typename Compare, typename BidirectionalIterator>
|
||||
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<Result>(
|
||||
cont, comp, first, last,
|
||||
|
@ -60,9 +70,9 @@ namespace sprout {
|
|||
)
|
||||
;
|
||||
}
|
||||
template<typename Result, typename Container, typename Compare, typename Iterator>
|
||||
template<typename Result, typename Container, typename Compare, typename BidirectionalIterator>
|
||||
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<Result>(
|
||||
cont, comp, first, last,
|
||||
|
|
|
@ -23,9 +23,14 @@ namespace sprout {
|
|||
true
|
||||
);
|
||||
}
|
||||
template<typename Result, typename Container, typename Compare, typename Iterator>
|
||||
template<typename Result, typename Container, typename Compare, typename BidirectionalIterator>
|
||||
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<Result>(
|
||||
cont, comp, first, last,
|
||||
i, ii, sprout::prev(j)
|
||||
|
@ -36,9 +41,14 @@ namespace sprout {
|
|||
)
|
||||
;
|
||||
}
|
||||
template<typename Result, typename Container, typename Compare, typename Iterator>
|
||||
template<typename Result, typename Container, typename Compare, typename BidirectionalIterator>
|
||||
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<Result>(
|
||||
cont, comp, first, last,
|
||||
i, ii, last
|
||||
|
@ -50,9 +60,9 @@ namespace sprout {
|
|||
)
|
||||
;
|
||||
}
|
||||
template<typename Result, typename Container, typename Compare, typename Iterator>
|
||||
template<typename Result, typename Container, typename Compare, typename BidirectionalIterator>
|
||||
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<Result>(
|
||||
cont, comp, first, last,
|
||||
|
@ -60,9 +70,9 @@ namespace sprout {
|
|||
)
|
||||
;
|
||||
}
|
||||
template<typename Result, typename Container, typename Compare, typename Iterator>
|
||||
template<typename Result, typename Container, typename Compare, typename BidirectionalIterator>
|
||||
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<Result>(
|
||||
cont, comp, first, last,
|
||||
|
|
|
@ -291,8 +291,8 @@ namespace sprout {
|
|||
bit_count_ + 8
|
||||
);
|
||||
}
|
||||
template<typename Iterator>
|
||||
SPROUT_CONSTEXPR md5 const process_block_impl(Iterator first, Iterator last) const {
|
||||
template<typename InputIterator>
|
||||
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<typename Iterator>
|
||||
void process_block_impl(Iterator first, Iterator last) {
|
||||
template<typename InputIterator>
|
||||
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<typename Iterator>
|
||||
SPROUT_CONSTEXPR md5 const process_block(Iterator bytes_begin, Iterator bytes_end) const {
|
||||
template<typename InputIterator>
|
||||
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<typename Iterator>
|
||||
SPROUT_CONSTEXPR md5 const process_bytes(Iterator buffer, std::size_t byte_count) const {
|
||||
template<typename InputIterator>
|
||||
SPROUT_CONSTEXPR md5 const process_bytes(InputIterator buffer, std::size_t byte_count) const {
|
||||
return process_block(buffer, sprout::next(buffer, byte_count));
|
||||
}
|
||||
template<typename Range>
|
||||
SPROUT_CONSTEXPR md5 const process_range(Range const& bytes_range) const {
|
||||
template<typename InputRange>
|
||||
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<typename Iterator>
|
||||
void process_block(Iterator bytes_begin, Iterator bytes_end) {
|
||||
template<typename InputIterator>
|
||||
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<typename Iterator>
|
||||
void process_bytes(Iterator buffer, std::size_t byte_count) {
|
||||
template<typename InputIterator>
|
||||
void process_bytes(InputIterator buffer, std::size_t byte_count) {
|
||||
process_block(buffer, sprout::next(buffer, byte_count));
|
||||
}
|
||||
template<typename Range>
|
||||
void process_range(Range const& bytes_range) {
|
||||
template<typename InputRange>
|
||||
void process_range(InputRange const& bytes_range) {
|
||||
process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
||||
}
|
||||
|
||||
|
|
|
@ -151,49 +151,54 @@ namespace sprout {
|
|||
SPROUT_CONSTEXPR sha1 const process_block() const {
|
||||
return sprout::throw_recursive_function_template_instantiation_exeeded();
|
||||
}
|
||||
template<int D = 16, typename Iterator, typename... Args, SPROUT_RECURSIVE_FUNCTION_TEMPLATE_CONTINUE(D)>
|
||||
template<int D = 16, typename InputIterator, typename... Args, SPROUT_RECURSIVE_FUNCTION_TEMPLATE_CONTINUE(D)>
|
||||
SPROUT_CONSTEXPR typename std::enable_if<sizeof...(Args) == 64, sha1 const>::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<D + 1>(
|
||||
h_,
|
||||
sprout::make_array<std::uint8_t>(args...),
|
||||
64,
|
||||
bit_count_ + 64 * 8
|
||||
)
|
||||
: /*process<D + 1>(
|
||||
h_,
|
||||
sprout::make_array<std::uint8_t>(args...),
|
||||
64,
|
||||
bit_count_ + 64 * 8
|
||||
).template process_block_impl<D + 1>(first, last)*/ sprout::throw_recursive_function_template_instantiation_exeeded()
|
||||
// !!!
|
||||
// : process<D + 1>(
|
||||
// h_,
|
||||
// sprout::make_array<std::uint8_t>(args...),
|
||||
// 64,
|
||||
// bit_count_ + 64 * 8
|
||||
// ).template process_block_impl<D + 1>(first, last)
|
||||
: sprout::throw_recursive_function_template_instantiation_exeeded()
|
||||
;
|
||||
}
|
||||
template<int D = 16, typename Iterator, typename... Args, SPROUT_RECURSIVE_FUNCTION_TEMPLATE_BREAK(D)>
|
||||
template<int D = 16, typename InputIterator, typename... Args, SPROUT_RECURSIVE_FUNCTION_TEMPLATE_BREAK(D)>
|
||||
SPROUT_CONSTEXPR typename std::enable_if<sizeof...(Args) == 64, sha1 const>::type
|
||||
process_block_impl(Iterator, Iterator, Args...) const {
|
||||
process_block_impl(InputIterator, InputIterator, Args...) const {
|
||||
return sprout::throw_recursive_function_template_instantiation_exeeded();
|
||||
}
|
||||
template<int D = 16, typename Iterator, typename... Args, SPROUT_RECURSIVE_FUNCTION_TEMPLATE_CONTINUE(D)>
|
||||
template<int D = 16, typename InputIterator, typename... Args, SPROUT_RECURSIVE_FUNCTION_TEMPLATE_CONTINUE(D)>
|
||||
SPROUT_CONSTEXPR typename std::enable_if<sizeof...(Args) != 64, sha1 const>::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<D + 1>(
|
||||
h_,
|
||||
sprout::get_internal(sprout::range::fixed::copy(sprout::make_array<std::uint8_t>(args...), sprout::sub(block_, block_byte_index_))),
|
||||
block_byte_index_ + sizeof...(Args),
|
||||
bit_count_ + sizeof...(Args) * 8
|
||||
)
|
||||
: block_byte_index_ + sizeof...(Args) == 64 ? /*process<D + 1>(
|
||||
h_,
|
||||
sprout::get_internal(sprout::range::fixed::copy(sprout::make_array<std::uint8_t>(args...), sprout::sub(block_, block_byte_index_))),
|
||||
block_byte_index_ + sizeof...(Args),
|
||||
bit_count_ + sizeof...(Args) * 8
|
||||
).template process_block_impl<D + 1>(first, last)*/ sprout::throw_recursive_function_template_instantiation_exeeded()
|
||||
: block_byte_index_ + sizeof...(Args) == 64
|
||||
// !!!
|
||||
// ? process<D + 1>(
|
||||
// h_,
|
||||
// sprout::get_internal(sprout::range::fixed::copy(sprout::make_array<std::uint8_t>(args...), sprout::sub(block_, block_byte_index_))),
|
||||
// block_byte_index_ + sizeof...(Args),
|
||||
// bit_count_ + sizeof...(Args) * 8
|
||||
// ).template process_block_impl<D + 1>(first, last)
|
||||
? sprout::throw_recursive_function_template_instantiation_exeeded()
|
||||
: process_block_impl<D + 1>(sprout::next(first), last, args..., *first)
|
||||
;
|
||||
}
|
||||
template<int D = 16, typename Iterator, typename... Args, SPROUT_RECURSIVE_FUNCTION_TEMPLATE_BREAK(D)>
|
||||
template<int D = 16, typename InputIterator, typename... Args, SPROUT_RECURSIVE_FUNCTION_TEMPLATE_BREAK(D)>
|
||||
SPROUT_CONSTEXPR typename std::enable_if<sizeof...(Args) != 64, sha1 const>::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<typename Iterator, typename... Args>
|
||||
template<typename InputIterator, typename... Args>
|
||||
SPROUT_CONSTEXPR typename std::enable_if<sizeof...(Args) == 64, sha1 const>::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<std::uint8_t>(args...),
|
||||
|
@ -270,9 +275,9 @@ namespace sprout {
|
|||
).process_block_impl(first, last)
|
||||
;
|
||||
}
|
||||
template<typename Iterator, typename... Args>
|
||||
template<typename InputIterator, typename... Args>
|
||||
SPROUT_CONSTEXPR typename std::enable_if<sizeof...(Args) != 64, sha1 const>::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<std::uint8_t>(args...), sprout::sub(block_, block_byte_index_))),
|
||||
|
@ -419,8 +424,8 @@ namespace sprout {
|
|||
process_block();
|
||||
}
|
||||
}
|
||||
template<typename Iterator>
|
||||
void process_block_impl(Iterator first, Iterator last) {
|
||||
template<typename InputIterator>
|
||||
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<typename Iterator>
|
||||
SPROUT_CONSTEXPR sha1 const process_block(Iterator bytes_begin, Iterator bytes_end) const {
|
||||
template<typename InputIterator>
|
||||
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<typename Iterator>
|
||||
SPROUT_CONSTEXPR sha1 const process_bytes(Iterator buffer, std::size_t byte_count) const {
|
||||
template<typename InputIterator>
|
||||
SPROUT_CONSTEXPR sha1 const process_bytes(InputIterator buffer, std::size_t byte_count) const {
|
||||
return process_block(buffer, sprout::next(buffer, byte_count));
|
||||
}
|
||||
template<typename Range>
|
||||
SPROUT_CONSTEXPR sha1 const process_range(Range const& bytes_range) const {
|
||||
template<typename InputRange>
|
||||
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<typename Iterator>
|
||||
void process_block(Iterator bytes_begin, Iterator bytes_end) {
|
||||
template<typename InputIterator>
|
||||
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<typename Iterator>
|
||||
void process_bytes(Iterator buffer, std::size_t byte_count) {
|
||||
template<typename InputIterator>
|
||||
void process_bytes(InputIterator buffer, std::size_t byte_count) {
|
||||
process_block(buffer, sprout::next(buffer, byte_count));
|
||||
}
|
||||
template<typename Range>
|
||||
void process_range(Range const& bytes_range) {
|
||||
template<typename InputRange>
|
||||
void process_range(InputRange const& bytes_range) {
|
||||
process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
||||
}
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ namespace sprout {
|
|||
private:
|
||||
sum_type sum_;
|
||||
private:
|
||||
template<typename Iterator>
|
||||
SPROUT_CONSTEXPR sum_type calc_sum(Iterator first, Iterator last) const {
|
||||
template<typename InputIterator>
|
||||
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<typename Iterator>
|
||||
SPROUT_CONSTEXPR sum_basic const process_block(Iterator bytes_begin, Iterator bytes_end) const {
|
||||
template<typename InputIterator>
|
||||
SPROUT_CONSTEXPR sum_basic const process_block(InputIterator bytes_begin, InputIterator bytes_end) const {
|
||||
return sum_basic(calc_sum(bytes_begin, bytes_end));
|
||||
}
|
||||
template<typename Iterator>
|
||||
SPROUT_CONSTEXPR sum_basic const process_bytes(Iterator buffer, std::size_t byte_count) const {
|
||||
template<typename InputIterator>
|
||||
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<typename Range>
|
||||
SPROUT_CONSTEXPR sum_basic const process_range(Range const& bytes_range) const {
|
||||
template<typename InputRange>
|
||||
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<typename Iterator>
|
||||
void process_block(Iterator bytes_begin, Iterator bytes_end) {
|
||||
template<typename InputIterator>
|
||||
void process_block(InputIterator bytes_begin, InputIterator bytes_end) {
|
||||
sum_ = calc_sum(bytes_begin, bytes_end);
|
||||
}
|
||||
template<typename Iterator>
|
||||
void process_bytes(Iterator buffer, std::size_t byte_count) {
|
||||
template<typename InputIterator>
|
||||
void process_bytes(InputIterator buffer, std::size_t byte_count) {
|
||||
process_block(buffer, sprout::next(buffer, byte_count));
|
||||
}
|
||||
template<typename Range>
|
||||
void process_range(Range const& bytes_range) {
|
||||
template<typename InputRange>
|
||||
void process_range(InputRange const& bytes_range) {
|
||||
process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
||||
}
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@ namespace sprout {
|
|||
private:
|
||||
sum_type sum_;
|
||||
private:
|
||||
template<typename Iterator>
|
||||
SPROUT_CONSTEXPR sum_type calc_sum(Iterator first, Iterator last) const {
|
||||
template<typename InputIterator>
|
||||
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<typename Iterator>
|
||||
SPROUT_CONSTEXPR xor8 const process_block(Iterator bytes_begin, Iterator bytes_end) const {
|
||||
template<typename InputIterator>
|
||||
SPROUT_CONSTEXPR xor8 const process_block(InputIterator bytes_begin, InputIterator bytes_end) const {
|
||||
return xor8(calc_sum(bytes_begin, bytes_end));
|
||||
}
|
||||
template<typename Iterator>
|
||||
SPROUT_CONSTEXPR xor8 const process_bytes(Iterator buffer, std::size_t byte_count) const {
|
||||
template<typename InputIterator>
|
||||
SPROUT_CONSTEXPR xor8 const process_bytes(InputIterator buffer, std::size_t byte_count) const {
|
||||
return process_block(buffer, sprout::next(buffer, byte_count));
|
||||
}
|
||||
template<typename Range>
|
||||
SPROUT_CONSTEXPR xor8 const process_range(Range const& bytes_range) const {
|
||||
template<typename InputRange>
|
||||
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<typename Iterator>
|
||||
void process_block(Iterator bytes_begin, Iterator bytes_end) {
|
||||
template<typename InputIterator>
|
||||
void process_block(InputIterator bytes_begin, InputIterator bytes_end) {
|
||||
sum_ = calc_sum(bytes_begin, bytes_end);
|
||||
}
|
||||
template<typename Iterator>
|
||||
void process_bytes(Iterator buffer, std::size_t byte_count) {
|
||||
template<typename InputIterator>
|
||||
void process_bytes(InputIterator buffer, std::size_t byte_count) {
|
||||
process_block(buffer, sprout::next(buffer, byte_count));
|
||||
}
|
||||
template<typename Range>
|
||||
void process_range(Range const& bytes_range) {
|
||||
template<typename InputRange>
|
||||
void process_range(InputRange const& bytes_range) {
|
||||
process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
||||
}
|
||||
|
||||
|
|
|
@ -41,10 +41,10 @@ namespace sprout {
|
|||
//
|
||||
// hash_range
|
||||
//
|
||||
template<typename Iterator>
|
||||
SPROUT_CONSTEXPR std::size_t hash_range(std::size_t seed, Iterator first, Iterator last);
|
||||
template<typename Iterator>
|
||||
SPROUT_CONSTEXPR std::size_t hash_range(Iterator first, Iterator last);
|
||||
template<typename InputIterator>
|
||||
SPROUT_CONSTEXPR std::size_t hash_range(std::size_t seed, InputIterator first, InputIterator last);
|
||||
template<typename InputIterator>
|
||||
SPROUT_CONSTEXPR std::size_t hash_range(InputIterator first, InputIterator last);
|
||||
template<typename InputRange>
|
||||
SPROUT_CONSTEXPR std::size_t hash_range(std::size_t seed, InputRange const& rng);
|
||||
template<typename InputRange>
|
||||
|
|
|
@ -729,9 +729,9 @@ namespace sprout {
|
|||
}
|
||||
|
||||
namespace detail {
|
||||
template<typename Elem, typename Iterator, std::size_t K, typename... Args>
|
||||
template<typename Elem, typename RandomAccessIterator, std::size_t K, typename... Args>
|
||||
inline SPROUT_CONSTEXPR Elem
|
||||
get_param(Iterator found, sprout::array<std::size_t, K> const& sizes, std::size_t idx, Args const&... args) {
|
||||
get_param(RandomAccessIterator found, sprout::array<std::size_t, K> const& sizes, std::size_t idx, Args const&... args) {
|
||||
return found == sizes.end() ? static_cast<Elem>('\0')
|
||||
: sprout::detail::param_seq_at<Elem>(
|
||||
found - sizes.begin(),
|
||||
|
|
|
@ -12,53 +12,53 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.2.8 Adjacent find
|
||||
template<typename Range>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
adjacent_find(Range&& range) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename ForwardRange>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||
adjacent_find(ForwardRange&& range) {
|
||||
return sprout::range::range_return<ForwardRange>::pack(
|
||||
sprout::adjacent_find(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range))
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range))
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
adjacent_find(Range&& range, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename ForwardRange, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||
adjacent_find(ForwardRange&& range, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<ForwardRange>::pack(
|
||||
sprout::adjacent_find(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
pred
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
adjacent_find(Range&& range) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||
adjacent_find(ForwardRange&& range) {
|
||||
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||
sprout::adjacent_find(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range))
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range))
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
adjacent_find(Range&& range, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||
adjacent_find(ForwardRange&& range, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||
sprout::adjacent_find(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
pred
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.2.1 All of
|
||||
template<typename Range, typename Predicate>
|
||||
template<typename InputRange, typename Predicate>
|
||||
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
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
|||
//
|
||||
// all_of_equal
|
||||
//
|
||||
template<typename Range, typename T>
|
||||
template<typename InputRange, typename T>
|
||||
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
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.2.2 Any of
|
||||
template<typename Range, typename Predicate>
|
||||
template<typename InputRange, typename Predicate>
|
||||
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
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
|||
//
|
||||
// any_of_equal
|
||||
//
|
||||
template<typename Range, typename T>
|
||||
template<typename InputRange, typename T>
|
||||
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
|
||||
|
|
|
@ -10,15 +10,15 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.4.3.4 binary_search
|
||||
template<typename Range, typename T>
|
||||
template<typename ForwardRange, typename T>
|
||||
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<typename Range, typename T, typename Compare>
|
||||
template<typename ForwardRange, typename T, typename Compare>
|
||||
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
|
||||
|
|
|
@ -11,9 +11,9 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.2.9 Count
|
||||
template<typename Range, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::container_traits<Range const>::difference_type
|
||||
count(Range const& range, T const& value) {
|
||||
template<typename InputRange, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::container_traits<InputRange const>::difference_type
|
||||
count(InputRange const& range, T const& value) {
|
||||
return sprout::count(sprout::begin(range), sprout::end(range), value);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -11,9 +11,9 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.2.9 Count
|
||||
template<typename Range, typename Predicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::container_traits<Range const>::difference_type
|
||||
count_if(Range const& range, Predicate pred) {
|
||||
template<typename InputRange, typename Predicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::container_traits<InputRange const>::difference_type
|
||||
count_if(InputRange const& range, Predicate pred) {
|
||||
return sprout::count_if(sprout::begin(range), sprout::end(range), pred);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -10,15 +10,15 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.2.11 Equal
|
||||
template<typename Range1, typename Range2>
|
||||
template<typename InputRange1, typename InputRange2>
|
||||
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<typename Range1, typename Range2, typename BinaryPredicate>
|
||||
template<typename InputRange1, typename InputRange2, typename BinaryPredicate>
|
||||
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
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
namespace sprout {
|
||||
namespace range {
|
||||
namespace detail {
|
||||
template<typename Range, typename Pair>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range<Range>::type
|
||||
template<typename ForwardRange, typename Pair>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range<ForwardRange>::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<typename Range, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range<Range>::type
|
||||
equal_range(Range&& range, T const& value) {
|
||||
return sprout::range::detail::pair_to_range<Range>(
|
||||
template<typename ForwardRange, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range<ForwardRange>::type
|
||||
equal_range(ForwardRange&& range, T const& value) {
|
||||
return sprout::range::detail::pair_to_range<ForwardRange>(
|
||||
sprout::equal_range(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
value
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range, typename T, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range<Range>::type
|
||||
equal_range(Range&& range, T const& value, Compare comp) {
|
||||
return sprout::range::detail::pair_to_range<Range>(
|
||||
template<typename ForwardRange, typename T, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range<ForwardRange>::type
|
||||
equal_range(ForwardRange&& range, T const& value, Compare comp) {
|
||||
return sprout::range::detail::pair_to_range<ForwardRange>(
|
||||
sprout::equal_range(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
value,
|
||||
comp
|
||||
)
|
||||
|
|
|
@ -12,29 +12,29 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.2.5 Find
|
||||
template<typename Range, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
find(Range&& range, T const& value) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename InputRange, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange>::type
|
||||
find(InputRange&& range, T const& value) {
|
||||
return sprout::range::range_return<InputRange>::pack(
|
||||
sprout::find(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<InputRange>(range)),
|
||||
sprout::end(sprout::forward<InputRange>(range)),
|
||||
value
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<InputRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
find(Range&& range, T const& value) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename InputRange, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange, RetV>::type
|
||||
find(InputRange&& range, T const& value) {
|
||||
return sprout::range::range_return<InputRange, RetV>::pack(
|
||||
sprout::find(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<InputRange>(range)),
|
||||
sprout::end(sprout::forward<InputRange>(range)),
|
||||
value
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<InputRange>(range)
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -13,32 +13,32 @@ namespace sprout {
|
|||
//
|
||||
// find_difference
|
||||
//
|
||||
template<typename Range1, typename Range2, typename Compare>
|
||||
template<typename InputRange1, typename InputRange2, typename Compare>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
||||
typename sprout::range::lvalue_iterator<Range2>::type
|
||||
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||
typename sprout::range::lvalue_iterator<InputRange2>::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>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2)),
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||
sprout::end(sprout::forward<InputRange2>(range2)),
|
||||
comp
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range1, typename Range2>
|
||||
template<typename InputRange1, typename InputRange2>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
||||
typename sprout::range::lvalue_iterator<Range2>::type
|
||||
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||
typename sprout::range::lvalue_iterator<InputRange2>::type
|
||||
>
|
||||
find_difference(Range1&& range1, Range2&& range2) {
|
||||
find_difference(InputRange1&& range1, InputRange2&& range2) {
|
||||
return sprout::find_difference(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2))
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||
sprout::end(sprout::forward<InputRange2>(range2))
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -12,61 +12,61 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.2.6 Find end
|
||||
template<typename Range1, typename Range2>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1>::type
|
||||
find_end(Range1&& range1, Range2&& range2) {
|
||||
return sprout::range::range_return<Range1>::pack(
|
||||
template<typename ForwardRange1, typename ForwardRange2>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange1>::type
|
||||
find_end(ForwardRange1&& range1, ForwardRange2&& range2) {
|
||||
return sprout::range::range_return<ForwardRange1>::pack(
|
||||
sprout::find_end(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2))
|
||||
sprout::begin(sprout::forward<ForwardRange1>(range1)),
|
||||
sprout::end(sprout::forward<ForwardRange1>(range1)),
|
||||
sprout::begin(sprout::forward<ForwardRange2>(range2)),
|
||||
sprout::end(sprout::forward<ForwardRange2>(range2))
|
||||
),
|
||||
sprout::forward<Range1>(range1)
|
||||
sprout::forward<ForwardRange1>(range1)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range1, typename Range2, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1>::type
|
||||
find_end(Range1&& range1, Range2&& range2, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<Range1>::pack(
|
||||
template<typename ForwardRange1, typename ForwardRange2, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange1>::type
|
||||
find_end(ForwardRange1&& range1, ForwardRange2&& range2, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<ForwardRange1>::pack(
|
||||
sprout::find_end(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2)),
|
||||
sprout::begin(sprout::forward<ForwardRange1>(range1)),
|
||||
sprout::end(sprout::forward<ForwardRange1>(range1)),
|
||||
sprout::begin(sprout::forward<ForwardRange2>(range2)),
|
||||
sprout::end(sprout::forward<ForwardRange2>(range2)),
|
||||
pred
|
||||
),
|
||||
sprout::forward<Range1>(range1)
|
||||
sprout::forward<ForwardRange1>(range1)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range1, typename Range2>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1, RetV>::type
|
||||
find_end(Range1&& range1, Range2&& range2) {
|
||||
return sprout::range::range_return<Range1, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange1, typename ForwardRange2>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange1, RetV>::type
|
||||
find_end(ForwardRange1&& range1, ForwardRange2&& range2) {
|
||||
return sprout::range::range_return<ForwardRange1, RetV>::pack(
|
||||
sprout::find_end(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2))
|
||||
sprout::begin(sprout::forward<ForwardRange1>(range1)),
|
||||
sprout::end(sprout::forward<ForwardRange1>(range1)),
|
||||
sprout::begin(sprout::forward<ForwardRange2>(range2)),
|
||||
sprout::end(sprout::forward<ForwardRange2>(range2))
|
||||
),
|
||||
sprout::forward<Range1>(range1)
|
||||
sprout::forward<ForwardRange1>(range1)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range1, typename Range2, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1, RetV>::type
|
||||
find_end(Range1&& range1, Range2&& range2, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<Range1, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange1, typename ForwardRange2, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange1, RetV>::type
|
||||
find_end(ForwardRange1&& range1, ForwardRange2&& range2, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<ForwardRange1, RetV>::pack(
|
||||
sprout::find_end(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2)),
|
||||
sprout::begin(sprout::forward<ForwardRange1>(range1)),
|
||||
sprout::end(sprout::forward<ForwardRange1>(range1)),
|
||||
sprout::begin(sprout::forward<ForwardRange2>(range2)),
|
||||
sprout::end(sprout::forward<ForwardRange2>(range2)),
|
||||
pred
|
||||
),
|
||||
sprout::forward<Range1>(range1)
|
||||
sprout::forward<ForwardRange1>(range1)
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -12,61 +12,61 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.2.7 Find first
|
||||
template<typename Range1, typename Range2>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1>::type
|
||||
find_first_of(Range1&& range1, Range2&& range2) {
|
||||
return sprout::range::range_return<Range1>::pack(
|
||||
template<typename InputRange1, typename InputRange2>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange1>::type
|
||||
find_first_of(InputRange1&& range1, InputRange2&& range2) {
|
||||
return sprout::range::range_return<InputRange1>::pack(
|
||||
sprout::find_first_of(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2))
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||
sprout::end(sprout::forward<InputRange2>(range2))
|
||||
),
|
||||
sprout::forward<Range1>(range1)
|
||||
sprout::forward<InputRange1>(range1)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range1, typename Range2, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1>::type
|
||||
find_first_of(Range1&& range1, Range2&& range2, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<Range1>::pack(
|
||||
template<typename InputRange1, typename InputRange2, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange1>::type
|
||||
find_first_of(InputRange1&& range1, InputRange2&& range2, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<InputRange1>::pack(
|
||||
sprout::find_first_of(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2)),
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||
sprout::end(sprout::forward<InputRange2>(range2)),
|
||||
pred
|
||||
),
|
||||
sprout::forward<Range1>(range1)
|
||||
sprout::forward<InputRange1>(range1)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range1, typename Range2>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1, RetV>::type
|
||||
find_first_of(Range1&& range1, Range2&& range2) {
|
||||
return sprout::range::range_return<Range1, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename InputRange1, typename InputRange2>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange1, RetV>::type
|
||||
find_first_of(InputRange1&& range1, InputRange2&& range2) {
|
||||
return sprout::range::range_return<InputRange1, RetV>::pack(
|
||||
sprout::find_first_of(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2))
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||
sprout::end(sprout::forward<InputRange2>(range2))
|
||||
),
|
||||
sprout::forward<Range1>(range1)
|
||||
sprout::forward<InputRange1>(range1)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range1, typename Range2, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1, RetV>::type
|
||||
find_first_of(Range1&& range1, Range2&& range2, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<Range1, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename InputRange1, typename InputRange2, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange1, RetV>::type
|
||||
find_first_of(InputRange1&& range1, InputRange2&& range2, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<InputRange1, RetV>::pack(
|
||||
sprout::find_first_of(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2)),
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||
sprout::end(sprout::forward<InputRange2>(range2)),
|
||||
pred
|
||||
),
|
||||
sprout::forward<Range1>(range1)
|
||||
sprout::forward<InputRange1>(range1)
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -12,29 +12,29 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.2.5 Find
|
||||
template<typename Range, typename Predicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
find_if(Range&& range, Predicate pred) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename InputRange, typename Predicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange>::type
|
||||
find_if(InputRange&& range, Predicate pred) {
|
||||
return sprout::range::range_return<InputRange>::pack(
|
||||
sprout::find_if(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<InputRange>(range)),
|
||||
sprout::end(sprout::forward<InputRange>(range)),
|
||||
pred
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<InputRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range, typename Predicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
find_if(Range&& range, Predicate pred) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename InputRange, typename Predicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange, RetV>::type
|
||||
find_if(InputRange&& range, Predicate pred) {
|
||||
return sprout::range::range_return<InputRange, RetV>::pack(
|
||||
sprout::find_if(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<InputRange>(range)),
|
||||
sprout::end(sprout::forward<InputRange>(range)),
|
||||
pred
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<InputRange>(range)
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -12,29 +12,29 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.2.5 Find
|
||||
template<typename Range, typename Predicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
find_if_not(Range&& range, Predicate pred) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename InputRange, typename Predicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange>::type
|
||||
find_if_not(InputRange&& range, Predicate pred) {
|
||||
return sprout::range::range_return<InputRange>::pack(
|
||||
sprout::find_if_not(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<InputRange>(range)),
|
||||
sprout::end(sprout::forward<InputRange>(range)),
|
||||
pred
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<InputRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range, typename Predicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
find_if_not(Range&& range, Predicate pred) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename InputRange, typename Predicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange, RetV>::type
|
||||
find_if_not(InputRange&& range, Predicate pred) {
|
||||
return sprout::range::range_return<InputRange, RetV>::pack(
|
||||
sprout::find_if_not(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<InputRange>(range)),
|
||||
sprout::end(sprout::forward<InputRange>(range)),
|
||||
pred
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<InputRange>(range)
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -13,32 +13,32 @@ namespace sprout {
|
|||
//
|
||||
// find_intersection
|
||||
//
|
||||
template<typename Range1, typename Range2, typename Compare>
|
||||
template<typename InputRange1, typename InputRange2, typename Compare>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
||||
typename sprout::range::lvalue_iterator<Range2>::type
|
||||
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||
typename sprout::range::lvalue_iterator<InputRange2>::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>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2)),
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||
sprout::end(sprout::forward<InputRange2>(range2)),
|
||||
comp
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range1, typename Range2>
|
||||
template<typename InputRange1, typename InputRange2>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
||||
typename sprout::range::lvalue_iterator<Range2>::type
|
||||
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||
typename sprout::range::lvalue_iterator<InputRange2>::type
|
||||
>
|
||||
find_intersection(Range1&& range1, Range2&& range2) {
|
||||
find_intersection(InputRange1&& range1, InputRange2&& range2) {
|
||||
return sprout::find_intersection(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2))
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||
sprout::end(sprout::forward<InputRange2>(range2))
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -13,32 +13,32 @@ namespace sprout {
|
|||
//
|
||||
// find_symmetric_difference
|
||||
//
|
||||
template<typename Range1, typename Range2, typename Compare>
|
||||
template<typename InputRange1, typename InputRange2, typename Compare>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
||||
typename sprout::range::lvalue_iterator<Range2>::type
|
||||
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||
typename sprout::range::lvalue_iterator<InputRange2>::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>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2)),
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||
sprout::end(sprout::forward<InputRange2>(range2)),
|
||||
comp
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range1, typename Range2>
|
||||
template<typename InputRange1, typename InputRange2>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
||||
typename sprout::range::lvalue_iterator<Range2>::type
|
||||
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||
typename sprout::range::lvalue_iterator<InputRange2>::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>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2))
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||
sprout::end(sprout::forward<InputRange2>(range2))
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -10,15 +10,15 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.4.5.1 includes
|
||||
template<typename Range1, typename Range2>
|
||||
template<typename InputRange1, typename InputRange2>
|
||||
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<typename Range1, typename Range2, typename Compare>
|
||||
template<typename InputRange1, typename InputRange2, typename Compare>
|
||||
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
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
|||
//
|
||||
// is_decreasing
|
||||
//
|
||||
template<typename Range>
|
||||
template<typename ForwardRange>
|
||||
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
|
||||
|
|
|
@ -10,15 +10,15 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.4.6.5 is_heap
|
||||
template<typename Range>
|
||||
template<typename RandomAccessRange>
|
||||
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<typename Range, typename Compare>
|
||||
template<typename RandomAccessRange, typename Compare>
|
||||
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
|
||||
|
|
|
@ -12,53 +12,53 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.4.6.5 is_heap
|
||||
template<typename Range>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
is_heap_until(Range&& range) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename RandomAccessRange>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<RandomAccessRange>::type
|
||||
is_heap_until(RandomAccessRange&& range) {
|
||||
return sprout::range::range_return<RandomAccessRange>::pack(
|
||||
sprout::is_heap_until(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range))
|
||||
sprout::begin(sprout::forward<RandomAccessRange>(range)),
|
||||
sprout::end(sprout::forward<RandomAccessRange>(range))
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<RandomAccessRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
is_heap_until(Range&& range, Compare comp) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename RandomAccessRange, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<RandomAccessRange>::type
|
||||
is_heap_until(RandomAccessRange&& range, Compare comp) {
|
||||
return sprout::range::range_return<RandomAccessRange>::pack(
|
||||
sprout::is_heap_until(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<RandomAccessRange>(range)),
|
||||
sprout::end(sprout::forward<RandomAccessRange>(range)),
|
||||
comp
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<RandomAccessRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
is_heap_until(Range&& range) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename RandomAccessRange>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<RandomAccessRange, RetV>::type
|
||||
is_heap_until(RandomAccessRange&& range) {
|
||||
return sprout::range::range_return<RandomAccessRange, RetV>::pack(
|
||||
sprout::is_heap_until(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range))
|
||||
sprout::begin(sprout::forward<RandomAccessRange>(range)),
|
||||
sprout::end(sprout::forward<RandomAccessRange>(range))
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<RandomAccessRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
is_heap_until(Range&& range, Compare comp) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename RandomAccessRange, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<RandomAccessRange, RetV>::type
|
||||
is_heap_until(RandomAccessRange&& range, Compare comp) {
|
||||
return sprout::range::range_return<RandomAccessRange, RetV>::pack(
|
||||
sprout::is_heap_until(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<RandomAccessRange>(range)),
|
||||
sprout::end(sprout::forward<RandomAccessRange>(range)),
|
||||
comp
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<RandomAccessRange>(range)
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
|||
//
|
||||
// is_increasing
|
||||
//
|
||||
template<typename Range>
|
||||
template<typename ForwardRange>
|
||||
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
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.3.13 partitions
|
||||
template<typename Range, typename Predicate>
|
||||
template<typename InputRange, typename Predicate>
|
||||
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
|
||||
|
|
|
@ -10,15 +10,15 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.2.12 Is permutation
|
||||
template<typename Range1, typename Range2>
|
||||
template<typename ForwardRange1, typename ForwardRange2>
|
||||
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<typename Range1, typename Range2, typename BinaryPredicate>
|
||||
template<typename ForwardRange1, typename ForwardRange2, typename BinaryPredicate>
|
||||
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
|
||||
|
|
|
@ -10,15 +10,15 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.4.1.5 is_sorted
|
||||
template<typename Range>
|
||||
template<typename ForwardRange>
|
||||
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<typename Range, typename Compare>
|
||||
template<typename ForwardRange, typename Compare>
|
||||
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
|
||||
|
|
|
@ -12,53 +12,53 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.4.1.5 is_sorted
|
||||
template<typename Range>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
is_sorted_until(Range&& range) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename ForwardRange>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||
is_sorted_until(ForwardRange&& range) {
|
||||
return sprout::range::range_return<ForwardRange>::pack(
|
||||
sprout::is_sorted_until(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range))
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range))
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
is_sorted_until(Range&& range, Compare comp) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename ForwardRange, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||
is_sorted_until(ForwardRange&& range, Compare comp) {
|
||||
return sprout::range::range_return<ForwardRange>::pack(
|
||||
sprout::is_sorted_until(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
comp
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
is_sorted_until(Range&& range) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||
is_sorted_until(ForwardRange&& range) {
|
||||
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||
sprout::is_sorted_until(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range))
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range))
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
is_sorted_until(Range&& range, Compare comp) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||
is_sorted_until(ForwardRange&& range, Compare comp) {
|
||||
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||
sprout::is_sorted_until(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
comp
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
|||
//
|
||||
// is_strictly_decreasing
|
||||
//
|
||||
template<typename Range>
|
||||
template<typename ForwardRange>
|
||||
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
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
|||
//
|
||||
// is_strictly_increasing
|
||||
//
|
||||
template<typename Range>
|
||||
template<typename ForwardRange>
|
||||
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
|
||||
|
|
|
@ -10,17 +10,17 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.4.8 Lexicographical comparison
|
||||
template<typename Range1, typename Range2>
|
||||
template<typename InputRange1, typename InputRange2>
|
||||
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<typename Range1, typename Range2, typename Compare>
|
||||
template<typename InputRange1, typename InputRange2, typename Compare>
|
||||
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
|
||||
);
|
||||
|
|
|
@ -12,57 +12,57 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.4.3.1 lower_bound
|
||||
template<typename Range, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
lower_bound(Range&& range, T const& value) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename ForwardRange, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||
lower_bound(ForwardRange&& range, T const& value) {
|
||||
return sprout::range::range_return<ForwardRange>::pack(
|
||||
sprout::lower_bound(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
value
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range, typename T, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
lower_bound(Range&& range, T const& value, Compare comp) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename ForwardRange, typename T, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||
lower_bound(ForwardRange&& range, T const& value, Compare comp) {
|
||||
return sprout::range::range_return<ForwardRange>::pack(
|
||||
sprout::lower_bound(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
value,
|
||||
comp
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
lower_bound(Range&& range, T const& value) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||
lower_bound(ForwardRange&& range, T const& value) {
|
||||
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||
sprout::lower_bound(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
value
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range, typename T, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
lower_bound(Range&& range, T const& value, Compare comp) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange, typename T, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||
lower_bound(ForwardRange&& range, T const& value, Compare comp) {
|
||||
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||
sprout::lower_bound(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
value,
|
||||
comp
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -12,53 +12,53 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.4.7 Minimum and maximum
|
||||
template<typename Range>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
max_element(Range&& range) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename ForwardRange>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||
max_element(ForwardRange&& range) {
|
||||
return sprout::range::range_return<ForwardRange>::pack(
|
||||
sprout::max_element(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range))
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range))
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
max_element(Range&& range, Compare comp) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename ForwardRange, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||
max_element(ForwardRange&& range, Compare comp) {
|
||||
return sprout::range::range_return<ForwardRange>::pack(
|
||||
sprout::max_element(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
comp
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
max_element(Range&& range) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||
max_element(ForwardRange&& range) {
|
||||
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||
sprout::max_element(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range))
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range))
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
max_element(Range&& range, Compare comp) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||
max_element(ForwardRange&& range, Compare comp) {
|
||||
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||
sprout::max_element(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
comp
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -12,53 +12,53 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.4.7 Minimum and maximum
|
||||
template<typename Range>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
min_element(Range&& range) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename ForwardRange>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||
min_element(ForwardRange&& range) {
|
||||
return sprout::range::range_return<ForwardRange>::pack(
|
||||
sprout::min_element(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range))
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range))
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
min_element(Range&& range, Compare comp) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename ForwardRange, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||
min_element(ForwardRange&& range, Compare comp) {
|
||||
return sprout::range::range_return<ForwardRange>::pack(
|
||||
sprout::min_element(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
comp
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
min_element(Range&& range) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||
min_element(ForwardRange&& range) {
|
||||
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||
sprout::min_element(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range))
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range))
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
min_element(Range&& range, Compare comp) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||
min_element(ForwardRange&& range, Compare comp) {
|
||||
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||
sprout::min_element(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
comp
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -11,27 +11,27 @@
|
|||
namespace sprout {
|
||||
namespace range {
|
||||
namespace detail {
|
||||
template<typename Range, typename Pair>
|
||||
template<typename ForwardRange, typename Pair>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::range_return<Range>::type,
|
||||
typename sprout::range::range_return<Range>::type
|
||||
typename sprout::range::range_return<ForwardRange>::type,
|
||||
typename sprout::range::range_return<ForwardRange>::type
|
||||
>
|
||||
pack_pair(Pair const& pair, Range&& range) {
|
||||
pack_pair(Pair const& pair, ForwardRange&& range) {
|
||||
return {
|
||||
sprout::range::range_return<Range>::pack(pair.first, sprout::forward<Range>(range)),
|
||||
sprout::range::range_return<Range>::pack(pair.second, sprout::forward<Range>(range))
|
||||
sprout::range::range_return<ForwardRange>::pack(pair.first, sprout::forward<ForwardRange>(range)),
|
||||
sprout::range::range_return<ForwardRange>::pack(pair.second, sprout::forward<ForwardRange>(range))
|
||||
};
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range, typename Pair>
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange, typename Pair>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::range_return<Range, RetV>::type,
|
||||
typename sprout::range::range_return<Range, RetV>::type
|
||||
typename sprout::range::range_return<ForwardRange, RetV>::type,
|
||||
typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||
>
|
||||
pack_pair(Pair const& pair, Range&& range) {
|
||||
pack_pair(Pair const& pair, ForwardRange&& range) {
|
||||
return {
|
||||
sprout::range::range_return<Range, RetV>::pack(pair.first, sprout::forward<Range>(range)),
|
||||
sprout::range::range_return<Range, RetV>::pack(pair.second, sprout::forward<Range>(range))
|
||||
sprout::range::range_return<ForwardRange, RetV>::pack(pair.first, sprout::forward<ForwardRange>(range)),
|
||||
sprout::range::range_return<ForwardRange, RetV>::pack(pair.second, sprout::forward<ForwardRange>(range))
|
||||
};
|
||||
}
|
||||
} // namespace detail
|
||||
|
@ -39,65 +39,65 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.4.7 Minimum and maximum
|
||||
template<typename Range>
|
||||
template<typename ForwardRange>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::range_return<Range>::type,
|
||||
typename sprout::range::range_return<Range>::type
|
||||
typename sprout::range::range_return<ForwardRange>::type,
|
||||
typename sprout::range::range_return<ForwardRange>::type
|
||||
>
|
||||
minmax_element(Range&& range) {
|
||||
return sprout::range::detail::pack_pair<Range>(
|
||||
minmax_element(ForwardRange&& range) {
|
||||
return sprout::range::detail::pack_pair<ForwardRange>(
|
||||
sprout::minmax_element(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range))
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range))
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range, typename Compare>
|
||||
template<typename ForwardRange, typename Compare>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::range_return<Range>::type,
|
||||
typename sprout::range::range_return<Range>::type
|
||||
typename sprout::range::range_return<ForwardRange>::type,
|
||||
typename sprout::range::range_return<ForwardRange>::type
|
||||
>
|
||||
minmax_element(Range&& range, Compare comp) {
|
||||
return sprout::range::detail::pack_pair<Range>(
|
||||
minmax_element(ForwardRange&& range, Compare comp) {
|
||||
return sprout::range::detail::pack_pair<ForwardRange>(
|
||||
sprout::minmax_element(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
comp
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range>
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::range_return<Range, RetV>::type,
|
||||
typename sprout::range::range_return<Range, RetV>::type
|
||||
typename sprout::range::range_return<ForwardRange, RetV>::type,
|
||||
typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||
>
|
||||
minmax_element(Range&& range) {
|
||||
return sprout::range::detail::pack_pair<RetV, Range>(
|
||||
minmax_element(ForwardRange&& range) {
|
||||
return sprout::range::detail::pack_pair<RetV, ForwardRange>(
|
||||
sprout::minmax_element(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range))
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range))
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range, typename Compare>
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange, typename Compare>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::range_return<Range, RetV>::type,
|
||||
typename sprout::range::range_return<Range, RetV>::type
|
||||
typename sprout::range::range_return<ForwardRange, RetV>::type,
|
||||
typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||
>
|
||||
minmax_element(Range&& range, Compare comp) {
|
||||
return sprout::range::detail::pack_pair<RetV, Range>(
|
||||
minmax_element(ForwardRange&& range, Compare comp) {
|
||||
return sprout::range::detail::pack_pair<RetV, ForwardRange>(
|
||||
sprout::minmax_element(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
comp
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -13,29 +13,29 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.2.10 Mismatch
|
||||
template<typename Range1, typename Range2>
|
||||
template<typename InputRange1, typename InputRange2>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
||||
typename sprout::range::lvalue_iterator<Range2>::type
|
||||
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||
typename sprout::range::lvalue_iterator<InputRange2>::type
|
||||
>
|
||||
mismatch(Range1&& range1, Range2&& range2) {
|
||||
mismatch(InputRange1&& range1, InputRange2&& range2) {
|
||||
return sprout::mismatch(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2))
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2))
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range1, typename Range2, typename BinaryPredicate>
|
||||
template<typename InputRange1, typename InputRange2, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
||||
typename sprout::range::lvalue_iterator<Range2>::type
|
||||
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||
typename sprout::range::lvalue_iterator<InputRange2>::type
|
||||
>
|
||||
mismatch(Range1&& range1, Range2&& range2, BinaryPredicate pred) {
|
||||
mismatch(InputRange1&& range1, InputRange2&& range2, BinaryPredicate pred) {
|
||||
return sprout::mismatch(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||
pred
|
||||
);
|
||||
}
|
||||
|
|
|
@ -13,32 +13,32 @@ namespace sprout {
|
|||
//
|
||||
// next_difference
|
||||
//
|
||||
template<typename Range1, typename Range2, typename Compare>
|
||||
template<typename InputRange1, typename InputRange2, typename Compare>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
||||
typename sprout::range::lvalue_iterator<Range2>::type
|
||||
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||
typename sprout::range::lvalue_iterator<InputRange2>::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>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2)),
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||
sprout::end(sprout::forward<InputRange2>(range2)),
|
||||
comp
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range1, typename Range2>
|
||||
template<typename InputRange1, typename InputRange2>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
||||
typename sprout::range::lvalue_iterator<Range2>::type
|
||||
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||
typename sprout::range::lvalue_iterator<InputRange2>::type
|
||||
>
|
||||
next_difference(Range1&& range1, Range2&& range2) {
|
||||
next_difference(InputRange1&& range1, InputRange2&& range2) {
|
||||
return sprout::next_difference(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2))
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||
sprout::end(sprout::forward<InputRange2>(range2))
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -13,32 +13,32 @@ namespace sprout {
|
|||
//
|
||||
// next_intersection
|
||||
//
|
||||
template<typename Range1, typename Range2, typename Compare>
|
||||
template<typename InputRange1, typename InputRange2, typename Compare>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
||||
typename sprout::range::lvalue_iterator<Range2>::type
|
||||
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||
typename sprout::range::lvalue_iterator<InputRange2>::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>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2)),
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||
sprout::end(sprout::forward<InputRange2>(range2)),
|
||||
comp
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range1, typename Range2>
|
||||
template<typename InputRange1, typename InputRange2>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
||||
typename sprout::range::lvalue_iterator<Range2>::type
|
||||
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||
typename sprout::range::lvalue_iterator<InputRange2>::type
|
||||
>
|
||||
next_intersection(Range1&& range1, Range2&& range2) {
|
||||
next_intersection(InputRange1&& range1, InputRange2&& range2) {
|
||||
return sprout::next_intersection(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2))
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||
sprout::end(sprout::forward<InputRange2>(range2))
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -13,32 +13,32 @@ namespace sprout {
|
|||
//
|
||||
// next_union
|
||||
//
|
||||
template<typename Range1, typename Range2, typename Compare>
|
||||
template<typename InputRange1, typename InputRange2, typename Compare>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
||||
typename sprout::range::lvalue_iterator<Range2>::type
|
||||
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||
typename sprout::range::lvalue_iterator<InputRange2>::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>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2)),
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||
sprout::end(sprout::forward<InputRange2>(range2)),
|
||||
comp
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range1, typename Range2>
|
||||
template<typename InputRange1, typename InputRange2>
|
||||
inline SPROUT_CONSTEXPR sprout::pair<
|
||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
||||
typename sprout::range::lvalue_iterator<Range2>::type
|
||||
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||
typename sprout::range::lvalue_iterator<InputRange2>::type
|
||||
>
|
||||
next_union(Range1&& range1, Range2&& range2) {
|
||||
next_union(InputRange1&& range1, InputRange2&& range2) {
|
||||
return sprout::next_union(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2))
|
||||
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||
sprout::end(sprout::forward<InputRange2>(range2))
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.2.3 None of
|
||||
template<typename Range, typename Predicate>
|
||||
template<typename InputRange, typename Predicate>
|
||||
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
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
|||
//
|
||||
// none_of_equal
|
||||
//
|
||||
template<typename Range, typename T>
|
||||
template<typename InputRange, typename T>
|
||||
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
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
|||
//
|
||||
// one_of
|
||||
//
|
||||
template<typename Range, typename Predicate>
|
||||
template<typename InputRange, typename Predicate>
|
||||
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
|
||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
|||
//
|
||||
// one_of_equal
|
||||
//
|
||||
template<typename Range, typename T>
|
||||
template<typename InputRange, typename T>
|
||||
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
|
||||
|
|
|
@ -12,16 +12,16 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.3.13 partitions
|
||||
template<typename Range, typename Predicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
partition_point(Range&& range, Predicate pred) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename ForwardRange, typename Predicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||
partition_point(ForwardRange&& range, Predicate pred) {
|
||||
return sprout::range::range_return<ForwardRange>::pack(
|
||||
sprout::partition_point(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
pred
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -12,61 +12,61 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.2.13 Search
|
||||
template<typename Range1, typename Range2>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1>::type
|
||||
search(Range1&& range1, Range2&& range2) {
|
||||
return sprout::range::range_return<Range1>::pack(
|
||||
template<typename ForwardRange1, typename ForwardRange2>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange1>::type
|
||||
search(ForwardRange1&& range1, ForwardRange2&& range2) {
|
||||
return sprout::range::range_return<ForwardRange1>::pack(
|
||||
sprout::search(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2))
|
||||
sprout::begin(sprout::forward<ForwardRange1>(range1)),
|
||||
sprout::end(sprout::forward<ForwardRange1>(range1)),
|
||||
sprout::begin(sprout::forward<ForwardRange2>(range2)),
|
||||
sprout::end(sprout::forward<ForwardRange2>(range2))
|
||||
),
|
||||
sprout::forward<Range1>(range1)
|
||||
sprout::forward<ForwardRange1>(range1)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range1, typename Range2, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1>::type
|
||||
search(Range1&& range1, Range2&& range2, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<Range1>::pack(
|
||||
template<typename ForwardRange1, typename ForwardRange2, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange1>::type
|
||||
search(ForwardRange1&& range1, ForwardRange2&& range2, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<ForwardRange1>::pack(
|
||||
sprout::search(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2)),
|
||||
sprout::begin(sprout::forward<ForwardRange1>(range1)),
|
||||
sprout::end(sprout::forward<ForwardRange1>(range1)),
|
||||
sprout::begin(sprout::forward<ForwardRange2>(range2)),
|
||||
sprout::end(sprout::forward<ForwardRange2>(range2)),
|
||||
pred
|
||||
),
|
||||
sprout::forward<Range1>(range1)
|
||||
sprout::forward<ForwardRange1>(range1)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range1, typename Range2>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1, RetV>::type
|
||||
search(Range1&& range1, Range2&& range2) {
|
||||
return sprout::range::range_return<Range1, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange1, typename ForwardRange2>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange1, RetV>::type
|
||||
search(ForwardRange1&& range1, ForwardRange2&& range2) {
|
||||
return sprout::range::range_return<ForwardRange1, RetV>::pack(
|
||||
sprout::search(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2))
|
||||
sprout::begin(sprout::forward<ForwardRange1>(range1)),
|
||||
sprout::end(sprout::forward<ForwardRange1>(range1)),
|
||||
sprout::begin(sprout::forward<ForwardRange2>(range2)),
|
||||
sprout::end(sprout::forward<ForwardRange2>(range2))
|
||||
),
|
||||
sprout::forward<Range1>(range1)
|
||||
sprout::forward<ForwardRange1>(range1)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range1, typename Range2, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1, RetV>::type
|
||||
search(Range1&& range1, Range2&& range2, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<Range1, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange1, typename ForwardRange2, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange1, RetV>::type
|
||||
search(ForwardRange1&& range1, ForwardRange2&& range2, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<ForwardRange1, RetV>::pack(
|
||||
sprout::search(
|
||||
sprout::begin(sprout::forward<Range1>(range1)),
|
||||
sprout::end(sprout::forward<Range1>(range1)),
|
||||
sprout::begin(sprout::forward<Range2>(range2)),
|
||||
sprout::end(sprout::forward<Range2>(range2)),
|
||||
sprout::begin(sprout::forward<ForwardRange1>(range1)),
|
||||
sprout::end(sprout::forward<ForwardRange1>(range1)),
|
||||
sprout::begin(sprout::forward<ForwardRange2>(range2)),
|
||||
sprout::end(sprout::forward<ForwardRange2>(range2)),
|
||||
pred
|
||||
),
|
||||
sprout::forward<Range1>(range1)
|
||||
sprout::forward<ForwardRange1>(range1)
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -12,61 +12,61 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.2.13 Search
|
||||
template<typename Range, typename Size, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
search_n(Range&& range, Size count, T const& value) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename ForwardRange, typename Size, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||
search_n(ForwardRange&& range, Size count, T const& value) {
|
||||
return sprout::range::range_return<ForwardRange>::pack(
|
||||
sprout::search_n(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
count,
|
||||
value
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range, typename Size, typename T, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
search_n(Range&& range, Size count, T const& value, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename ForwardRange, typename Size, typename T, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||
search_n(ForwardRange&& range, Size count, T const& value, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<ForwardRange>::pack(
|
||||
sprout::search_n(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
count,
|
||||
value,
|
||||
pred
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range, typename Size, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
search_n(Range&& range, Size count, T const& value) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange, typename Size, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||
search_n(ForwardRange&& range, Size count, T const& value) {
|
||||
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||
sprout::search_n(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
count,
|
||||
value
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range, typename Size, typename T, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
search_n(Range&& range, Size count, T const& value, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange, typename Size, typename T, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||
search_n(ForwardRange&& range, Size count, T const& value, BinaryPredicate pred) {
|
||||
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||
sprout::search_n(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
count,
|
||||
value,
|
||||
pred
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -10,33 +10,33 @@ namespace sprout {
|
|||
//
|
||||
// tristate_lexicographical_compare
|
||||
//
|
||||
template<typename Range1, typename Range2>
|
||||
template<typename InputRange1, typename InputRange2>
|
||||
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<typename Range1, typename Range2, typename Compare>
|
||||
template<typename InputRange1, typename InputRange2, typename Compare>
|
||||
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<typename Range1, typename T1, typename Range2, typename T2>
|
||||
template<typename InputRange1, typename T1, typename InputRange2, typename T2>
|
||||
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<typename Range1, typename T1, typename Range2, typename T2, typename Compare>
|
||||
template<typename InputRange1, typename T1, typename InputRange2, typename T2, typename Compare>
|
||||
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
|
||||
);
|
||||
|
|
|
@ -12,57 +12,57 @@ namespace sprout {
|
|||
// Copyright (C) 2011 RiSK (sscrisk)
|
||||
|
||||
// 25.4.3.2 upper_bound
|
||||
template<typename Range, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
upper_bound(Range&& range, T const& value) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename ForwardRange, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||
upper_bound(ForwardRange&& range, T const& value) {
|
||||
return sprout::range::range_return<ForwardRange>::pack(
|
||||
sprout::upper_bound(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
value
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Range, typename T, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
||||
upper_bound(Range&& range, T const& value, Compare comp) {
|
||||
return sprout::range::range_return<Range>::pack(
|
||||
template<typename ForwardRange, typename T, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||
upper_bound(ForwardRange&& range, T const& value, Compare comp) {
|
||||
return sprout::range::range_return<ForwardRange>::pack(
|
||||
sprout::upper_bound(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
value,
|
||||
comp
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
upper_bound(Range&& range, T const& value) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange, typename T>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||
upper_bound(ForwardRange&& range, T const& value) {
|
||||
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||
sprout::upper_bound(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
value
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
|
||||
template<sprout::range::range_return_value RetV, typename Range, typename T, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
||||
upper_bound(Range&& range, T const& value, Compare comp) {
|
||||
return sprout::range::range_return<Range, RetV>::pack(
|
||||
template<sprout::range::range_return_value RetV, typename ForwardRange, typename T, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||
upper_bound(ForwardRange&& range, T const& value, Compare comp) {
|
||||
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||
sprout::upper_bound(
|
||||
sprout::begin(sprout::forward<Range>(range)),
|
||||
sprout::end(sprout::forward<Range>(range)),
|
||||
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||
value,
|
||||
comp
|
||||
),
|
||||
sprout::forward<Range>(range)
|
||||
sprout::forward<ForwardRange>(range)
|
||||
);
|
||||
}
|
||||
} // namespace range
|
||||
|
|
|
@ -7,15 +7,15 @@
|
|||
namespace sprout {
|
||||
namespace range {
|
||||
// 26.7.2 Accumulate
|
||||
template<typename Range, typename T, typename BinaryOperation>
|
||||
template<typename InputRange, typename T, typename BinaryOperation>
|
||||
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<typename Range, typename T>
|
||||
template<typename InputRange, typename T>
|
||||
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
|
||||
|
|
|
@ -7,19 +7,19 @@
|
|||
namespace sprout {
|
||||
namespace range {
|
||||
// 26.7.3 Inner product
|
||||
template<typename Range1, typename Range2, typename T, typename BinaryOperation1, typename BinaryOperation2>
|
||||
template<typename InputRange1, typename InputRange2, typename T, typename BinaryOperation1, typename BinaryOperation2>
|
||||
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<typename Range1, typename Range2, typename T>
|
||||
template<typename InputRange1, typename InputRange2, typename T>
|
||||
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
|
||||
|
|
|
@ -21,16 +21,16 @@ namespace sprout {
|
|||
public:
|
||||
typedef sprout::uuids::uuid result_type;
|
||||
private:
|
||||
template<typename Iterator>
|
||||
template<typename ForwardIterator>
|
||||
struct next_char {
|
||||
public:
|
||||
typedef typename std::iterator_traits<Iterator>::value_type char_type;
|
||||
typedef typename std::iterator_traits<ForwardIterator>::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<typename Iterator, typename Char, typename... Args>
|
||||
template<typename ForwardIterator, typename Char, typename... Args>
|
||||
SPROUT_CONSTEXPR result_type
|
||||
generate_2_3(next_char<Iterator> nc, Char open_brace, bool has_dashes, std::uint8_t byte, Args... args) const {
|
||||
generate_2_3(next_char<ForwardIterator> 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<std::uint8_t>((byte << 4) | get_value(nc.c)));
|
||||
}
|
||||
template<typename Iterator, typename Char, typename... Args>
|
||||
template<typename ForwardIterator, typename Char, typename... Args>
|
||||
SPROUT_CONSTEXPR result_type
|
||||
generate_2_2(next_char<Iterator> nc, Char open_brace, bool has_dashes, Args... args) const {
|
||||
generate_2_2(next_char<ForwardIterator> 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<typename Iterator, typename Char, typename... Args>
|
||||
template<typename ForwardIterator, typename Char, typename... Args>
|
||||
SPROUT_CONSTEXPR typename std::enable_if<
|
||||
sizeof...(Args) == 6 || sizeof...(Args) == 8 || sizeof...(Args) == 10,
|
||||
result_type
|
||||
>::type
|
||||
generate_2_1(next_char<Iterator> nc, Char open_brace, bool has_dashes, Args... args) const {
|
||||
generate_2_1(next_char<ForwardIterator> 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<typename Iterator, typename Char, typename... Args>
|
||||
template<typename ForwardIterator, typename Char, typename... Args>
|
||||
SPROUT_CONSTEXPR typename std::enable_if<
|
||||
sizeof...(Args) == 4,
|
||||
result_type
|
||||
>::type
|
||||
generate_2_1(next_char<Iterator> nc, Char open_brace, bool, Args... args) const {
|
||||
generate_2_1(next_char<ForwardIterator> 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<typename Iterator, typename Char, typename... Args>
|
||||
template<typename ForwardIterator, typename Char, typename... Args>
|
||||
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<Iterator> nc, Char open_brace, bool has_dashes, Args... args) const {
|
||||
generate_2_1(next_char<ForwardIterator> nc, Char open_brace, bool has_dashes, Args... args) const {
|
||||
return generate_2_2(nc, open_brace, has_dashes, args...);
|
||||
}
|
||||
template<typename Iterator, typename Char, typename... Args>
|
||||
template<typename ForwardIterator, typename Char, typename... Args>
|
||||
SPROUT_CONSTEXPR typename std::enable_if<
|
||||
sizeof...(Args) == 16,
|
||||
result_type
|
||||
>::type
|
||||
generate_2(next_char<Iterator> nc, Char open_brace, bool, Args... args) const {
|
||||
generate_2(next_char<ForwardIterator> 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<typename Iterator, typename Char, typename... Args>
|
||||
template<typename ForwardIterator, typename Char, typename... Args>
|
||||
SPROUT_CONSTEXPR typename std::enable_if<
|
||||
sizeof...(Args) == 0,
|
||||
result_type
|
||||
>::type
|
||||
generate_2(next_char<Iterator> nc, Char open_brace, bool has_dashes, Args... args) const {
|
||||
generate_2(next_char<ForwardIterator> nc, Char open_brace, bool has_dashes, Args... args) const {
|
||||
return generate_2_2(nc, open_brace, has_dashes, args...);
|
||||
}
|
||||
template<typename Iterator, typename Char, typename... Args>
|
||||
template<typename ForwardIterator, typename Char, typename... Args>
|
||||
SPROUT_CONSTEXPR typename std::enable_if<
|
||||
sizeof...(Args) != 0 && sizeof...(Args) != 16,
|
||||
result_type
|
||||
>::type
|
||||
generate_2(next_char<Iterator> nc, Char open_brace, bool has_dashes, Args... args) const {
|
||||
generate_2(next_char<ForwardIterator> nc, Char open_brace, bool has_dashes, Args... args) const {
|
||||
return generate_2_1(nc.next(), open_brace, has_dashes, args...);
|
||||
}
|
||||
template<typename Iterator>
|
||||
template<typename ForwardIterator>
|
||||
SPROUT_CONSTEXPR result_type
|
||||
generate_1(next_char<Iterator> nc) const {
|
||||
generate_1(next_char<ForwardIterator> nc) const {
|
||||
return is_open_brace(nc.c)
|
||||
? generate_2(nc.next(), nc.c, false)
|
||||
: generate_2(nc, typename next_char<Iterator>::char_type(), false)
|
||||
: generate_2(nc, typename next_char<ForwardIterator>::char_type(), false)
|
||||
;
|
||||
}
|
||||
public:
|
||||
template<typename Iterator>
|
||||
SPROUT_CONSTEXPR result_type operator()(Iterator first, Iterator last) const {
|
||||
return generate_1(next_char<Iterator>(first, last));
|
||||
template<typename ForwardIterator>
|
||||
SPROUT_CONSTEXPR result_type operator()(ForwardIterator first, ForwardIterator last) const {
|
||||
return generate_1(next_char<ForwardIterator>(first, last));
|
||||
}
|
||||
template<typename Elem, std::size_t N, typename Traits>
|
||||
SPROUT_CONSTEXPR result_type operator()(sprout::basic_string<Elem, N, Traits> const& s) const {
|
||||
|
@ -201,9 +201,9 @@ namespace sprout {
|
|||
//
|
||||
// make_uuid
|
||||
//
|
||||
template<typename Iterator>
|
||||
template<typename ForwardIterator>
|
||||
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<typename Elem, std::size_t N, typename Traits>
|
||||
|
|
|
@ -116,10 +116,10 @@ namespace sprout {
|
|||
return sprout::to_string(U"x500");
|
||||
}
|
||||
|
||||
template<typename Range>
|
||||
template<typename InputRange>
|
||||
inline SPROUT_CONSTEXPR sprout::uuids::md5_name_generator
|
||||
uuid3_impl(Range const& rng) {
|
||||
typedef typename std::decay<typename sprout::containers::value_type<Range>::type>::type value_type;
|
||||
uuid3_impl(InputRange const& rng) {
|
||||
typedef typename std::decay<typename sprout::containers::value_type<InputRange>::type>::type value_type;
|
||||
typedef sprout::ctypes::nocase_equal_to<value_type> predicate_type;
|
||||
return sprout::range::equal(rng, sprout::uuids::detail::dns_token<value_type>(), predicate_type()) ? sprout::uuids::make_uuid3_dns()
|
||||
: sprout::range::equal(rng, sprout::uuids::detail::url_token<value_type>(), predicate_type()) ? sprout::uuids::make_uuid3_url()
|
||||
|
@ -129,10 +129,10 @@ namespace sprout {
|
|||
;
|
||||
}
|
||||
|
||||
template<typename Range>
|
||||
template<typename InputRange>
|
||||
inline SPROUT_CONSTEXPR sprout::uuids::sha1_name_generator
|
||||
uuid5_impl(Range const& rng) {
|
||||
typedef typename std::decay<typename sprout::containers::value_type<Range>::type>::type value_type;
|
||||
uuid5_impl(InputRange const& rng) {
|
||||
typedef typename std::decay<typename sprout::containers::value_type<InputRange>::type>::type value_type;
|
||||
typedef sprout::ctypes::nocase_equal_to<value_type> predicate_type;
|
||||
return sprout::range::equal(rng, sprout::uuids::detail::dns_token<value_type>(), predicate_type()) ? sprout::uuids::make_uuid5_dns()
|
||||
: sprout::range::equal(rng, sprout::uuids::detail::url_token<value_type>(), predicate_type()) ? sprout::uuids::make_uuid5_url()
|
||||
|
|
|
@ -29,9 +29,9 @@ namespace testspr {
|
|||
: testspr::equal(first1 + 1, last1, first2 + 1, last2)
|
||||
;
|
||||
}
|
||||
template<typename Range1, typename Range2>
|
||||
template<typename InputRange1, typename InputRange2>
|
||||
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<typename Range, typename T>
|
||||
template<typename InputRange, typename T>
|
||||
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<typename Range, typename T>
|
||||
inline SPROUT_CONSTEXPR typename std::iterator_traits<typename Range::const_iterator>::difference_type
|
||||
count(Range const& range, T const& value) {
|
||||
template<typename InputRange, typename T>
|
||||
inline SPROUT_CONSTEXPR typename std::iterator_traits<typename InputRange::const_iterator>::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<typename Range1, typename Range2>
|
||||
template<typename ForwardRange1, typename ForwardRange2>
|
||||
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)
|
||||
|
|
|
@ -12,13 +12,13 @@ namespace testspr {
|
|||
//
|
||||
// print
|
||||
//
|
||||
template<typename Iterator>
|
||||
void print(Iterator first, Iterator last) {
|
||||
std::for_each(first, last, [](typename std::iterator_traits<Iterator>::value_type const& e){ std::cout << e << ' '; });
|
||||
template<typename InputIterator>
|
||||
void print(InputIterator first, InputIterator last) {
|
||||
std::for_each(first, last, [](typename std::iterator_traits<InputIterator>::value_type const& e){ std::cout << e << ' '; });
|
||||
std::cout << std::endl;
|
||||
}
|
||||
template<typename Range>
|
||||
void print(Range const& range) {
|
||||
template<typename InputRange>
|
||||
void print(InputRange const& range) {
|
||||
testspr::print(sprout::begin(range), sprout::end(range));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue