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
|
Compare comp
|
||||||
);
|
);
|
||||||
|
|
||||||
template<typename Container, typename Iterator>
|
template<typename Container, typename RandomAccessIterator>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::container_traits<Container>::value_type const&
|
inline SPROUT_CONSTEXPR typename sprout::container_traits<Container>::value_type const&
|
||||||
sort_select_pivot(
|
sort_select_pivot(
|
||||||
Iterator origin,
|
RandomAccessIterator origin,
|
||||||
typename sprout::container_traits<Container>::difference_type start,
|
typename sprout::container_traits<Container>::difference_type start,
|
||||||
typename sprout::container_traits<Container>::difference_type end
|
typename sprout::container_traits<Container>::difference_type end
|
||||||
)
|
)
|
||||||
{ // pivot ‚ð‘I‚Ô<E2809A>i’†‰›‚Ì—v‘f<E28098>j
|
{ // pivot ‚ð‘I‚Ô<E2809A>i’†‰›‚Ì—v‘f<E28098>j
|
||||||
return *sprout::next(origin, (end + start) / 2);
|
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
|
inline SPROUT_CONSTEXPR typename sprout::container_traits<Container>::difference_type
|
||||||
sort_find_l(
|
sort_find_l(
|
||||||
Iterator origin,
|
RandomAccessIterator origin,
|
||||||
Compare comp,
|
Compare comp,
|
||||||
typename sprout::container_traits<Container>::difference_type l,
|
typename sprout::container_traits<Container>::difference_type l,
|
||||||
typename sprout::container_traits<Container>::value_type const& p
|
typename sprout::container_traits<Container>::value_type const& p
|
||||||
|
@ -57,10 +57,10 @@ namespace sprout {
|
||||||
: l
|
: 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
|
inline SPROUT_CONSTEXPR typename sprout::container_traits<Container>::difference_type
|
||||||
sort_find_r(
|
sort_find_r(
|
||||||
Iterator origin,
|
RandomAccessIterator origin,
|
||||||
Compare comp,
|
Compare comp,
|
||||||
typename sprout::container_traits<Container>::difference_type r,
|
typename sprout::container_traits<Container>::difference_type r,
|
||||||
typename sprout::container_traits<Container>::value_type const& p
|
typename sprout::container_traits<Container>::value_type const& p
|
||||||
|
|
|
@ -23,9 +23,14 @@ namespace sprout {
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
template<typename Result, typename Container, typename Compare, typename Iterator>
|
template<typename Result, typename Container, typename Compare, typename BidirectionalIterator>
|
||||||
inline SPROUT_CONSTEXPR Result
|
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>(
|
return !comp(*i, *sprout::prev(j)) ? sprout::fixed::detail::next_permutation_impl_3<Result>(
|
||||||
cont, comp, first, last,
|
cont, comp, first, last,
|
||||||
i, ii, sprout::prev(j)
|
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
|
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>(
|
return comp(*i, *ii) ? sprout::fixed::detail::next_permutation_impl_3<Result>(
|
||||||
cont, comp, first, last,
|
cont, comp, first, last,
|
||||||
i, ii, 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
|
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)
|
return i == last ? Result(sprout::deep_copy(cont), false)
|
||||||
: sprout::fixed::detail::next_permutation_impl_2<Result>(
|
: sprout::fixed::detail::next_permutation_impl_2<Result>(
|
||||||
cont, comp, first, last,
|
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
|
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)
|
return first == last ? Result(sprout::deep_copy(cont), false)
|
||||||
: sprout::fixed::detail::next_permutation_impl_1<Result>(
|
: sprout::fixed::detail::next_permutation_impl_1<Result>(
|
||||||
cont, comp, first, last,
|
cont, comp, first, last,
|
||||||
|
|
|
@ -23,9 +23,14 @@ namespace sprout {
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
template<typename Result, typename Container, typename Compare, typename Iterator>
|
template<typename Result, typename Container, typename Compare, typename BidirectionalIterator>
|
||||||
inline SPROUT_CONSTEXPR Result
|
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>(
|
return !comp(*sprout::prev(j), *i) ? sprout::fixed::detail::prev_permutation_impl_3<Result>(
|
||||||
cont, comp, first, last,
|
cont, comp, first, last,
|
||||||
i, ii, sprout::prev(j)
|
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
|
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>(
|
return comp(*ii, *i) ? sprout::fixed::detail::prev_permutation_impl_3<Result>(
|
||||||
cont, comp, first, last,
|
cont, comp, first, last,
|
||||||
i, ii, 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
|
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)
|
return i == last ? Result(sprout::deep_copy(cont), false)
|
||||||
: sprout::fixed::detail::prev_permutation_impl_2<Result>(
|
: sprout::fixed::detail::prev_permutation_impl_2<Result>(
|
||||||
cont, comp, first, last,
|
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
|
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)
|
return first == last ? Result(sprout::deep_copy(cont), false)
|
||||||
: sprout::fixed::detail::prev_permutation_impl_1<Result>(
|
: sprout::fixed::detail::prev_permutation_impl_1<Result>(
|
||||||
cont, comp, first, last,
|
cont, comp, first, last,
|
||||||
|
|
|
@ -291,8 +291,8 @@ namespace sprout {
|
||||||
bit_count_ + 8
|
bit_count_ + 8
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
SPROUT_CONSTEXPR md5 const process_block_impl(Iterator first, Iterator last) const {
|
SPROUT_CONSTEXPR md5 const process_block_impl(InputIterator first, InputIterator last) const {
|
||||||
return first == last ? *this
|
return first == last ? *this
|
||||||
: process_byte(*first).process_block_impl(sprout::next(first), last)
|
: process_byte(*first).process_block_impl(sprout::next(first), last)
|
||||||
;
|
;
|
||||||
|
@ -344,8 +344,8 @@ namespace sprout {
|
||||||
k_[3] += x[3];
|
k_[3] += x[3];
|
||||||
block_.assign(0);
|
block_.assign(0);
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
void process_block_impl(Iterator first, Iterator last) {
|
void process_block_impl(InputIterator first, InputIterator last) {
|
||||||
for(; first != last; ++first) {
|
for(; first != last; ++first) {
|
||||||
process_byte(*first);
|
process_byte(*first);
|
||||||
}
|
}
|
||||||
|
@ -391,19 +391,19 @@ namespace sprout {
|
||||||
.process_bit((byte & 1) != 0)
|
.process_bit((byte & 1) != 0)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
SPROUT_CONSTEXPR md5 const process_block(Iterator bytes_begin, Iterator bytes_end) const {
|
SPROUT_CONSTEXPR md5 const process_block(InputIterator bytes_begin, InputIterator bytes_end) const {
|
||||||
return process_block_impl(
|
return process_block_impl(
|
||||||
sprout::make_bytes_iterator(bytes_begin),
|
sprout::make_bytes_iterator(bytes_begin),
|
||||||
sprout::make_bytes_iterator(bytes_end)
|
sprout::make_bytes_iterator(bytes_end)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
SPROUT_CONSTEXPR md5 const process_bytes(Iterator buffer, std::size_t byte_count) const {
|
SPROUT_CONSTEXPR md5 const process_bytes(InputIterator buffer, std::size_t byte_count) const {
|
||||||
return process_block(buffer, sprout::next(buffer, byte_count));
|
return process_block(buffer, sprout::next(buffer, byte_count));
|
||||||
}
|
}
|
||||||
template<typename Range>
|
template<typename InputRange>
|
||||||
SPROUT_CONSTEXPR md5 const process_range(Range const& bytes_range) const {
|
SPROUT_CONSTEXPR md5 const process_range(InputRange const& bytes_range) const {
|
||||||
return process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
return process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -423,19 +423,19 @@ namespace sprout {
|
||||||
void process_byte(std::uint8_t byte) {
|
void process_byte(std::uint8_t byte) {
|
||||||
process_bits(byte, 8);
|
process_bits(byte, 8);
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
void process_block(Iterator bytes_begin, Iterator bytes_end) {
|
void process_block(InputIterator bytes_begin, InputIterator bytes_end) {
|
||||||
process_block_impl(
|
process_block_impl(
|
||||||
sprout::make_bytes_iterator(bytes_begin),
|
sprout::make_bytes_iterator(bytes_begin),
|
||||||
sprout::make_bytes_iterator(bytes_end)
|
sprout::make_bytes_iterator(bytes_end)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
void process_bytes(Iterator buffer, std::size_t byte_count) {
|
void process_bytes(InputIterator buffer, std::size_t byte_count) {
|
||||||
process_block(buffer, sprout::next(buffer, byte_count));
|
process_block(buffer, sprout::next(buffer, byte_count));
|
||||||
}
|
}
|
||||||
template<typename Range>
|
template<typename InputRange>
|
||||||
void process_range(Range const& bytes_range) {
|
void process_range(InputRange const& bytes_range) {
|
||||||
process_block(sprout::begin(bytes_range), sprout::end(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 {
|
SPROUT_CONSTEXPR sha1 const process_block() const {
|
||||||
return sprout::throw_recursive_function_template_instantiation_exeeded();
|
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
|
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>(
|
return first == last ? process<D + 1>(
|
||||||
h_,
|
h_,
|
||||||
sprout::make_array<std::uint8_t>(args...),
|
sprout::make_array<std::uint8_t>(args...),
|
||||||
64,
|
64,
|
||||||
bit_count_ + 64 * 8
|
bit_count_ + 64 * 8
|
||||||
)
|
)
|
||||||
: /*process<D + 1>(
|
// !!!
|
||||||
h_,
|
// : process<D + 1>(
|
||||||
sprout::make_array<std::uint8_t>(args...),
|
// h_,
|
||||||
64,
|
// sprout::make_array<std::uint8_t>(args...),
|
||||||
bit_count_ + 64 * 8
|
// 64,
|
||||||
).template process_block_impl<D + 1>(first, last)*/ sprout::throw_recursive_function_template_instantiation_exeeded()
|
// 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
|
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();
|
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
|
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>(
|
return first == last ? process<D + 1>(
|
||||||
h_,
|
h_,
|
||||||
sprout::get_internal(sprout::range::fixed::copy(sprout::make_array<std::uint8_t>(args...), sprout::sub(block_, block_byte_index_))),
|
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),
|
block_byte_index_ + sizeof...(Args),
|
||||||
bit_count_ + sizeof...(Args) * 8
|
bit_count_ + sizeof...(Args) * 8
|
||||||
)
|
)
|
||||||
: block_byte_index_ + sizeof...(Args) == 64 ? /*process<D + 1>(
|
: block_byte_index_ + sizeof...(Args) == 64
|
||||||
h_,
|
// !!!
|
||||||
sprout::get_internal(sprout::range::fixed::copy(sprout::make_array<std::uint8_t>(args...), sprout::sub(block_, block_byte_index_))),
|
// ? process<D + 1>(
|
||||||
block_byte_index_ + sizeof...(Args),
|
// h_,
|
||||||
bit_count_ + sizeof...(Args) * 8
|
// sprout::get_internal(sprout::range::fixed::copy(sprout::make_array<std::uint8_t>(args...), sprout::sub(block_, block_byte_index_))),
|
||||||
).template process_block_impl<D + 1>(first, last)*/ sprout::throw_recursive_function_template_instantiation_exeeded()
|
// 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)
|
: 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
|
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();
|
return sprout::throw_recursive_function_template_instantiation_exeeded();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -253,9 +258,9 @@ namespace sprout {
|
||||||
SPROUT_CONSTEXPR sha1 const process_block() const {
|
SPROUT_CONSTEXPR sha1 const process_block() const {
|
||||||
return process_block_1(h_[0], h_[1], h_[2], h_[3], h_[4]);
|
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
|
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(
|
return first == last ? process(
|
||||||
h_,
|
h_,
|
||||||
sprout::make_array<std::uint8_t>(args...),
|
sprout::make_array<std::uint8_t>(args...),
|
||||||
|
@ -270,9 +275,9 @@ namespace sprout {
|
||||||
).process_block_impl(first, last)
|
).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
|
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(
|
return first == last ? process(
|
||||||
h_,
|
h_,
|
||||||
sprout::get_internal(sprout::range::fixed::copy(sprout::make_array<std::uint8_t>(args...), sprout::sub(block_, block_byte_index_))),
|
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();
|
process_block();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
void process_block_impl(Iterator first, Iterator last) {
|
void process_block_impl(InputIterator first, InputIterator last) {
|
||||||
for(; first != last; ++first) {
|
for(; first != last; ++first) {
|
||||||
process_byte(*first);
|
process_byte(*first);
|
||||||
}
|
}
|
||||||
|
@ -450,19 +455,19 @@ namespace sprout {
|
||||||
bit_count_ + 8
|
bit_count_ + 8
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
SPROUT_CONSTEXPR sha1 const process_block(Iterator bytes_begin, Iterator bytes_end) const {
|
SPROUT_CONSTEXPR sha1 const process_block(InputIterator bytes_begin, InputIterator bytes_end) const {
|
||||||
return process_block_impl(
|
return process_block_impl(
|
||||||
sprout::make_bytes_iterator(bytes_begin),
|
sprout::make_bytes_iterator(bytes_begin),
|
||||||
sprout::make_bytes_iterator(bytes_end)
|
sprout::make_bytes_iterator(bytes_end)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
SPROUT_CONSTEXPR sha1 const process_bytes(Iterator buffer, std::size_t byte_count) const {
|
SPROUT_CONSTEXPR sha1 const process_bytes(InputIterator buffer, std::size_t byte_count) const {
|
||||||
return process_block(buffer, sprout::next(buffer, byte_count));
|
return process_block(buffer, sprout::next(buffer, byte_count));
|
||||||
}
|
}
|
||||||
template<typename Range>
|
template<typename InputRange>
|
||||||
SPROUT_CONSTEXPR sha1 const process_range(Range const& bytes_range) const {
|
SPROUT_CONSTEXPR sha1 const process_range(InputRange const& bytes_range) const {
|
||||||
return process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
return process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -470,19 +475,19 @@ namespace sprout {
|
||||||
process_byte_impl(byte);
|
process_byte_impl(byte);
|
||||||
bit_count_ += 8;
|
bit_count_ += 8;
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
void process_block(Iterator bytes_begin, Iterator bytes_end) {
|
void process_block(InputIterator bytes_begin, InputIterator bytes_end) {
|
||||||
process_block_impl(
|
process_block_impl(
|
||||||
sprout::make_bytes_iterator(bytes_begin),
|
sprout::make_bytes_iterator(bytes_begin),
|
||||||
sprout::make_bytes_iterator(bytes_end)
|
sprout::make_bytes_iterator(bytes_end)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
void process_bytes(Iterator buffer, std::size_t byte_count) {
|
void process_bytes(InputIterator buffer, std::size_t byte_count) {
|
||||||
process_block(buffer, sprout::next(buffer, byte_count));
|
process_block(buffer, sprout::next(buffer, byte_count));
|
||||||
}
|
}
|
||||||
template<typename Range>
|
template<typename InputRange>
|
||||||
void process_range(Range const& bytes_range) {
|
void process_range(InputRange const& bytes_range) {
|
||||||
process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,8 @@ namespace sprout {
|
||||||
private:
|
private:
|
||||||
sum_type sum_;
|
sum_type sum_;
|
||||||
private:
|
private:
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
SPROUT_CONSTEXPR sum_type calc_sum(Iterator first, Iterator last) const {
|
SPROUT_CONSTEXPR sum_type calc_sum(InputIterator first, InputIterator last) const {
|
||||||
return sprout::accumulate(
|
return sprout::accumulate(
|
||||||
sprout::make_bytes_iterator(first),
|
sprout::make_bytes_iterator(first),
|
||||||
sprout::make_bytes_iterator(last),
|
sprout::make_bytes_iterator(last),
|
||||||
|
@ -54,32 +54,32 @@ namespace sprout {
|
||||||
SPROUT_CONSTEXPR sum_basic const process_byte(std::uint8_t byte) const {
|
SPROUT_CONSTEXPR sum_basic const process_byte(std::uint8_t byte) const {
|
||||||
return sum_basic(sum_ + byte);
|
return sum_basic(sum_ + byte);
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
SPROUT_CONSTEXPR sum_basic const process_block(Iterator bytes_begin, Iterator bytes_end) const {
|
SPROUT_CONSTEXPR sum_basic const process_block(InputIterator bytes_begin, InputIterator bytes_end) const {
|
||||||
return sum_basic(calc_sum(bytes_begin, bytes_end));
|
return sum_basic(calc_sum(bytes_begin, bytes_end));
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
SPROUT_CONSTEXPR sum_basic const process_bytes(Iterator buffer, std::size_t byte_count) const {
|
SPROUT_CONSTEXPR sum_basic const process_bytes(InputIterator buffer, std::size_t byte_count) const {
|
||||||
return process_block(buffer, sprout::next(buffer, byte_count));
|
return process_block(buffer, sprout::next(buffer, byte_count));
|
||||||
}
|
}
|
||||||
template<typename Range>
|
template<typename InputRange>
|
||||||
SPROUT_CONSTEXPR sum_basic const process_range(Range const& bytes_range) const {
|
SPROUT_CONSTEXPR sum_basic const process_range(InputRange const& bytes_range) const {
|
||||||
return process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
return process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
||||||
}
|
}
|
||||||
|
|
||||||
void process_byte(std::uint8_t byte) {
|
void process_byte(std::uint8_t byte) {
|
||||||
sum_ += byte;
|
sum_ += byte;
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
void process_block(Iterator bytes_begin, Iterator bytes_end) {
|
void process_block(InputIterator bytes_begin, InputIterator bytes_end) {
|
||||||
sum_ = calc_sum(bytes_begin, bytes_end);
|
sum_ = calc_sum(bytes_begin, bytes_end);
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
void process_bytes(Iterator buffer, std::size_t byte_count) {
|
void process_bytes(InputIterator buffer, std::size_t byte_count) {
|
||||||
process_block(buffer, sprout::next(buffer, byte_count));
|
process_block(buffer, sprout::next(buffer, byte_count));
|
||||||
}
|
}
|
||||||
template<typename Range>
|
template<typename InputRange>
|
||||||
void process_range(Range const& bytes_range) {
|
void process_range(InputRange const& bytes_range) {
|
||||||
process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,8 @@ namespace sprout {
|
||||||
private:
|
private:
|
||||||
sum_type sum_;
|
sum_type sum_;
|
||||||
private:
|
private:
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
SPROUT_CONSTEXPR sum_type calc_sum(Iterator first, Iterator last) const {
|
SPROUT_CONSTEXPR sum_type calc_sum(InputIterator first, InputIterator last) const {
|
||||||
return sprout::accumulate(
|
return sprout::accumulate(
|
||||||
sprout::make_bytes_iterator(first),
|
sprout::make_bytes_iterator(first),
|
||||||
sprout::make_bytes_iterator(last),
|
sprout::make_bytes_iterator(last),
|
||||||
|
@ -43,32 +43,32 @@ namespace sprout {
|
||||||
SPROUT_CONSTEXPR xor8 const process_byte(std::uint8_t byte) const {
|
SPROUT_CONSTEXPR xor8 const process_byte(std::uint8_t byte) const {
|
||||||
return xor8(sum_ ^ byte);
|
return xor8(sum_ ^ byte);
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
SPROUT_CONSTEXPR xor8 const process_block(Iterator bytes_begin, Iterator bytes_end) const {
|
SPROUT_CONSTEXPR xor8 const process_block(InputIterator bytes_begin, InputIterator bytes_end) const {
|
||||||
return xor8(calc_sum(bytes_begin, bytes_end));
|
return xor8(calc_sum(bytes_begin, bytes_end));
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
SPROUT_CONSTEXPR xor8 const process_bytes(Iterator buffer, std::size_t byte_count) const {
|
SPROUT_CONSTEXPR xor8 const process_bytes(InputIterator buffer, std::size_t byte_count) const {
|
||||||
return process_block(buffer, sprout::next(buffer, byte_count));
|
return process_block(buffer, sprout::next(buffer, byte_count));
|
||||||
}
|
}
|
||||||
template<typename Range>
|
template<typename InputRange>
|
||||||
SPROUT_CONSTEXPR xor8 const process_range(Range const& bytes_range) const {
|
SPROUT_CONSTEXPR xor8 const process_range(InputRange const& bytes_range) const {
|
||||||
return process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
return process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
||||||
}
|
}
|
||||||
|
|
||||||
void process_byte(std::uint8_t byte) {
|
void process_byte(std::uint8_t byte) {
|
||||||
sum_ ^= byte;
|
sum_ ^= byte;
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
void process_block(Iterator bytes_begin, Iterator bytes_end) {
|
void process_block(InputIterator bytes_begin, InputIterator bytes_end) {
|
||||||
sum_ = calc_sum(bytes_begin, bytes_end);
|
sum_ = calc_sum(bytes_begin, bytes_end);
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
void process_bytes(Iterator buffer, std::size_t byte_count) {
|
void process_bytes(InputIterator buffer, std::size_t byte_count) {
|
||||||
process_block(buffer, sprout::next(buffer, byte_count));
|
process_block(buffer, sprout::next(buffer, byte_count));
|
||||||
}
|
}
|
||||||
template<typename Range>
|
template<typename InputRange>
|
||||||
void process_range(Range const& bytes_range) {
|
void process_range(InputRange const& bytes_range) {
|
||||||
process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
process_block(sprout::begin(bytes_range), sprout::end(bytes_range));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,10 +41,10 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// hash_range
|
// hash_range
|
||||||
//
|
//
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
SPROUT_CONSTEXPR std::size_t hash_range(std::size_t seed, Iterator first, Iterator last);
|
SPROUT_CONSTEXPR std::size_t hash_range(std::size_t seed, InputIterator first, InputIterator last);
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
SPROUT_CONSTEXPR std::size_t hash_range(Iterator first, Iterator last);
|
SPROUT_CONSTEXPR std::size_t hash_range(InputIterator first, InputIterator last);
|
||||||
template<typename InputRange>
|
template<typename InputRange>
|
||||||
SPROUT_CONSTEXPR std::size_t hash_range(std::size_t seed, InputRange const& rng);
|
SPROUT_CONSTEXPR std::size_t hash_range(std::size_t seed, InputRange const& rng);
|
||||||
template<typename InputRange>
|
template<typename InputRange>
|
||||||
|
|
|
@ -729,9 +729,9 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace detail {
|
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
|
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')
|
return found == sizes.end() ? static_cast<Elem>('\0')
|
||||||
: sprout::detail::param_seq_at<Elem>(
|
: sprout::detail::param_seq_at<Elem>(
|
||||||
found - sizes.begin(),
|
found - sizes.begin(),
|
||||||
|
|
|
@ -12,53 +12,53 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.2.8 Adjacent find
|
// 25.2.8 Adjacent find
|
||||||
template<typename Range>
|
template<typename ForwardRange>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
adjacent_find(Range&& range) {
|
adjacent_find(ForwardRange&& range) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
sprout::adjacent_find(
|
sprout::adjacent_find(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range))
|
sprout::end(sprout::forward<ForwardRange>(range))
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Range, typename BinaryPredicate>
|
template<typename ForwardRange, typename BinaryPredicate>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
adjacent_find(Range&& range, BinaryPredicate pred) {
|
adjacent_find(ForwardRange&& range, BinaryPredicate pred) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
sprout::adjacent_find(
|
sprout::adjacent_find(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
pred
|
pred
|
||||||
),
|
),
|
||||||
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 typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
adjacent_find(Range&& range) {
|
adjacent_find(ForwardRange&& range) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
sprout::adjacent_find(
|
sprout::adjacent_find(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(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>
|
template<sprout::range::range_return_value RetV, typename ForwardRange, typename BinaryPredicate>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
adjacent_find(Range&& range, BinaryPredicate pred) {
|
adjacent_find(ForwardRange&& range, BinaryPredicate pred) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
sprout::adjacent_find(
|
sprout::adjacent_find(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
pred
|
pred
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.2.1 All of
|
// 25.2.1 All of
|
||||||
template<typename Range, typename Predicate>
|
template<typename InputRange, typename Predicate>
|
||||||
inline SPROUT_CONSTEXPR bool
|
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);
|
return sprout::all_of(sprout::begin(range), sprout::end(range), pred);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// all_of_equal
|
// all_of_equal
|
||||||
//
|
//
|
||||||
template<typename Range, typename T>
|
template<typename InputRange, typename T>
|
||||||
inline SPROUT_CONSTEXPR bool
|
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);
|
return sprout::all_of_equal(sprout::begin(range), sprout::end(range), value);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.2.2 Any of
|
// 25.2.2 Any of
|
||||||
template<typename Range, typename Predicate>
|
template<typename InputRange, typename Predicate>
|
||||||
inline SPROUT_CONSTEXPR bool
|
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);
|
return sprout::any_of(sprout::begin(range), sprout::end(range), pred);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// any_of_equal
|
// any_of_equal
|
||||||
//
|
//
|
||||||
template<typename Range, typename T>
|
template<typename InputRange, typename T>
|
||||||
inline SPROUT_CONSTEXPR bool
|
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);
|
return sprout::any_of_equal(sprout::begin(range), sprout::end(range), value);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,15 +10,15 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.4.3.4 binary_search
|
// 25.4.3.4 binary_search
|
||||||
template<typename Range, typename T>
|
template<typename ForwardRange, typename T>
|
||||||
inline SPROUT_CONSTEXPR bool
|
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);
|
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
|
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);
|
return sprout::binary_search(sprout::begin(range), sprout::end(range), value, comp);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -11,9 +11,9 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.2.9 Count
|
// 25.2.9 Count
|
||||||
template<typename Range, typename T>
|
template<typename InputRange, typename T>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::container_traits<Range const>::difference_type
|
inline SPROUT_CONSTEXPR typename sprout::container_traits<InputRange const>::difference_type
|
||||||
count(Range const& range, T const& value) {
|
count(InputRange const& range, T const& value) {
|
||||||
return sprout::count(sprout::begin(range), sprout::end(range), value);
|
return sprout::count(sprout::begin(range), sprout::end(range), value);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -11,9 +11,9 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.2.9 Count
|
// 25.2.9 Count
|
||||||
template<typename Range, typename Predicate>
|
template<typename InputRange, typename Predicate>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::container_traits<Range const>::difference_type
|
inline SPROUT_CONSTEXPR typename sprout::container_traits<InputRange const>::difference_type
|
||||||
count_if(Range const& range, Predicate pred) {
|
count_if(InputRange const& range, Predicate pred) {
|
||||||
return sprout::count_if(sprout::begin(range), sprout::end(range), pred);
|
return sprout::count_if(sprout::begin(range), sprout::end(range), pred);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,15 +10,15 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.2.11 Equal
|
// 25.2.11 Equal
|
||||||
template<typename Range1, typename Range2>
|
template<typename InputRange1, typename InputRange2>
|
||||||
inline SPROUT_CONSTEXPR bool
|
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));
|
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
|
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);
|
return sprout::equal(sprout::begin(range1), sprout::end(range1), sprout::begin(range2), pred);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace range {
|
namespace range {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
template<typename Range, typename Pair>
|
template<typename ForwardRange, typename Pair>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range<ForwardRange>::type
|
||||||
pair_to_range(Pair const& pair) {
|
pair_to_range(Pair const& pair) {
|
||||||
return {pair.first, pair.second};
|
return {pair.first, pair.second};
|
||||||
}
|
}
|
||||||
|
@ -20,25 +20,25 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.4.3.3 equal_range
|
// 25.4.3.3 equal_range
|
||||||
template<typename Range, typename T>
|
template<typename ForwardRange, typename T>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range<ForwardRange>::type
|
||||||
equal_range(Range&& range, T const& value) {
|
equal_range(ForwardRange&& range, T const& value) {
|
||||||
return sprout::range::detail::pair_to_range<Range>(
|
return sprout::range::detail::pair_to_range<ForwardRange>(
|
||||||
sprout::equal_range(
|
sprout::equal_range(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
value
|
value
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Range, typename T, typename Compare>
|
template<typename ForwardRange, typename T, typename Compare>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::lvalue_range<ForwardRange>::type
|
||||||
equal_range(Range&& range, T const& value, Compare comp) {
|
equal_range(ForwardRange&& range, T const& value, Compare comp) {
|
||||||
return sprout::range::detail::pair_to_range<Range>(
|
return sprout::range::detail::pair_to_range<ForwardRange>(
|
||||||
sprout::equal_range(
|
sprout::equal_range(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
value,
|
value,
|
||||||
comp
|
comp
|
||||||
)
|
)
|
||||||
|
|
|
@ -12,29 +12,29 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.2.5 Find
|
// 25.2.5 Find
|
||||||
template<typename Range, typename T>
|
template<typename InputRange, typename T>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange>::type
|
||||||
find(Range&& range, T const& value) {
|
find(InputRange&& range, T const& value) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<InputRange>::pack(
|
||||||
sprout::find(
|
sprout::find(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<InputRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<InputRange>(range)),
|
||||||
value
|
value
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<InputRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<sprout::range::range_return_value RetV, typename Range, typename T>
|
template<sprout::range::range_return_value RetV, typename InputRange, typename T>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange, RetV>::type
|
||||||
find(Range&& range, T const& value) {
|
find(InputRange&& range, T const& value) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<InputRange, RetV>::pack(
|
||||||
sprout::find(
|
sprout::find(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<InputRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<InputRange>(range)),
|
||||||
value
|
value
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<InputRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -13,32 +13,32 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// find_difference
|
// find_difference
|
||||||
//
|
//
|
||||||
template<typename Range1, typename Range2, typename Compare>
|
template<typename InputRange1, typename InputRange2, typename Compare>
|
||||||
inline SPROUT_CONSTEXPR sprout::pair<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||||
typename sprout::range::lvalue_iterator<Range2>::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(
|
return sprout::find_difference(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2)),
|
sprout::end(sprout::forward<InputRange2>(range2)),
|
||||||
comp
|
comp
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Range1, typename Range2>
|
template<typename InputRange1, typename InputRange2>
|
||||||
inline SPROUT_CONSTEXPR sprout::pair<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||||
typename sprout::range::lvalue_iterator<Range2>::type
|
typename sprout::range::lvalue_iterator<InputRange2>::type
|
||||||
>
|
>
|
||||||
find_difference(Range1&& range1, Range2&& range2) {
|
find_difference(InputRange1&& range1, InputRange2&& range2) {
|
||||||
return sprout::find_difference(
|
return sprout::find_difference(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2))
|
sprout::end(sprout::forward<InputRange2>(range2))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -12,61 +12,61 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.2.6 Find end
|
// 25.2.6 Find end
|
||||||
template<typename Range1, typename Range2>
|
template<typename ForwardRange1, typename ForwardRange2>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange1>::type
|
||||||
find_end(Range1&& range1, Range2&& range2) {
|
find_end(ForwardRange1&& range1, ForwardRange2&& range2) {
|
||||||
return sprout::range::range_return<Range1>::pack(
|
return sprout::range::range_return<ForwardRange1>::pack(
|
||||||
sprout::find_end(
|
sprout::find_end(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<ForwardRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<ForwardRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<ForwardRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2))
|
sprout::end(sprout::forward<ForwardRange2>(range2))
|
||||||
),
|
),
|
||||||
sprout::forward<Range1>(range1)
|
sprout::forward<ForwardRange1>(range1)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Range1, typename Range2, typename BinaryPredicate>
|
template<typename ForwardRange1, typename ForwardRange2, typename BinaryPredicate>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange1>::type
|
||||||
find_end(Range1&& range1, Range2&& range2, BinaryPredicate pred) {
|
find_end(ForwardRange1&& range1, ForwardRange2&& range2, BinaryPredicate pred) {
|
||||||
return sprout::range::range_return<Range1>::pack(
|
return sprout::range::range_return<ForwardRange1>::pack(
|
||||||
sprout::find_end(
|
sprout::find_end(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<ForwardRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<ForwardRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<ForwardRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2)),
|
sprout::end(sprout::forward<ForwardRange2>(range2)),
|
||||||
pred
|
pred
|
||||||
),
|
),
|
||||||
sprout::forward<Range1>(range1)
|
sprout::forward<ForwardRange1>(range1)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<sprout::range::range_return_value RetV, typename Range1, typename Range2>
|
template<sprout::range::range_return_value RetV, typename ForwardRange1, typename ForwardRange2>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange1, RetV>::type
|
||||||
find_end(Range1&& range1, Range2&& range2) {
|
find_end(ForwardRange1&& range1, ForwardRange2&& range2) {
|
||||||
return sprout::range::range_return<Range1, RetV>::pack(
|
return sprout::range::range_return<ForwardRange1, RetV>::pack(
|
||||||
sprout::find_end(
|
sprout::find_end(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<ForwardRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<ForwardRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<ForwardRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(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>
|
template<sprout::range::range_return_value RetV, typename ForwardRange1, typename ForwardRange2, typename BinaryPredicate>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange1, RetV>::type
|
||||||
find_end(Range1&& range1, Range2&& range2, BinaryPredicate pred) {
|
find_end(ForwardRange1&& range1, ForwardRange2&& range2, BinaryPredicate pred) {
|
||||||
return sprout::range::range_return<Range1, RetV>::pack(
|
return sprout::range::range_return<ForwardRange1, RetV>::pack(
|
||||||
sprout::find_end(
|
sprout::find_end(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<ForwardRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<ForwardRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<ForwardRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2)),
|
sprout::end(sprout::forward<ForwardRange2>(range2)),
|
||||||
pred
|
pred
|
||||||
),
|
),
|
||||||
sprout::forward<Range1>(range1)
|
sprout::forward<ForwardRange1>(range1)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -12,61 +12,61 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.2.7 Find first
|
// 25.2.7 Find first
|
||||||
template<typename Range1, typename Range2>
|
template<typename InputRange1, typename InputRange2>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange1>::type
|
||||||
find_first_of(Range1&& range1, Range2&& range2) {
|
find_first_of(InputRange1&& range1, InputRange2&& range2) {
|
||||||
return sprout::range::range_return<Range1>::pack(
|
return sprout::range::range_return<InputRange1>::pack(
|
||||||
sprout::find_first_of(
|
sprout::find_first_of(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2))
|
sprout::end(sprout::forward<InputRange2>(range2))
|
||||||
),
|
),
|
||||||
sprout::forward<Range1>(range1)
|
sprout::forward<InputRange1>(range1)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Range1, typename Range2, typename BinaryPredicate>
|
template<typename InputRange1, typename InputRange2, typename BinaryPredicate>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange1>::type
|
||||||
find_first_of(Range1&& range1, Range2&& range2, BinaryPredicate pred) {
|
find_first_of(InputRange1&& range1, InputRange2&& range2, BinaryPredicate pred) {
|
||||||
return sprout::range::range_return<Range1>::pack(
|
return sprout::range::range_return<InputRange1>::pack(
|
||||||
sprout::find_first_of(
|
sprout::find_first_of(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2)),
|
sprout::end(sprout::forward<InputRange2>(range2)),
|
||||||
pred
|
pred
|
||||||
),
|
),
|
||||||
sprout::forward<Range1>(range1)
|
sprout::forward<InputRange1>(range1)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<sprout::range::range_return_value RetV, typename Range1, typename Range2>
|
template<sprout::range::range_return_value RetV, typename InputRange1, typename InputRange2>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange1, RetV>::type
|
||||||
find_first_of(Range1&& range1, Range2&& range2) {
|
find_first_of(InputRange1&& range1, InputRange2&& range2) {
|
||||||
return sprout::range::range_return<Range1, RetV>::pack(
|
return sprout::range::range_return<InputRange1, RetV>::pack(
|
||||||
sprout::find_first_of(
|
sprout::find_first_of(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(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>
|
template<sprout::range::range_return_value RetV, typename InputRange1, typename InputRange2, typename BinaryPredicate>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange1, RetV>::type
|
||||||
find_first_of(Range1&& range1, Range2&& range2, BinaryPredicate pred) {
|
find_first_of(InputRange1&& range1, InputRange2&& range2, BinaryPredicate pred) {
|
||||||
return sprout::range::range_return<Range1, RetV>::pack(
|
return sprout::range::range_return<InputRange1, RetV>::pack(
|
||||||
sprout::find_first_of(
|
sprout::find_first_of(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2)),
|
sprout::end(sprout::forward<InputRange2>(range2)),
|
||||||
pred
|
pred
|
||||||
),
|
),
|
||||||
sprout::forward<Range1>(range1)
|
sprout::forward<InputRange1>(range1)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -12,29 +12,29 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.2.5 Find
|
// 25.2.5 Find
|
||||||
template<typename Range, typename Predicate>
|
template<typename InputRange, typename Predicate>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange>::type
|
||||||
find_if(Range&& range, Predicate pred) {
|
find_if(InputRange&& range, Predicate pred) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<InputRange>::pack(
|
||||||
sprout::find_if(
|
sprout::find_if(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<InputRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<InputRange>(range)),
|
||||||
pred
|
pred
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<InputRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<sprout::range::range_return_value RetV, typename Range, typename Predicate>
|
template<sprout::range::range_return_value RetV, typename InputRange, typename Predicate>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange, RetV>::type
|
||||||
find_if(Range&& range, Predicate pred) {
|
find_if(InputRange&& range, Predicate pred) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<InputRange, RetV>::pack(
|
||||||
sprout::find_if(
|
sprout::find_if(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<InputRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<InputRange>(range)),
|
||||||
pred
|
pred
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<InputRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -12,29 +12,29 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.2.5 Find
|
// 25.2.5 Find
|
||||||
template<typename Range, typename Predicate>
|
template<typename InputRange, typename Predicate>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange>::type
|
||||||
find_if_not(Range&& range, Predicate pred) {
|
find_if_not(InputRange&& range, Predicate pred) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<InputRange>::pack(
|
||||||
sprout::find_if_not(
|
sprout::find_if_not(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<InputRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<InputRange>(range)),
|
||||||
pred
|
pred
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<InputRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<sprout::range::range_return_value RetV, typename Range, typename Predicate>
|
template<sprout::range::range_return_value RetV, typename InputRange, typename Predicate>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<InputRange, RetV>::type
|
||||||
find_if_not(Range&& range, Predicate pred) {
|
find_if_not(InputRange&& range, Predicate pred) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<InputRange, RetV>::pack(
|
||||||
sprout::find_if_not(
|
sprout::find_if_not(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<InputRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<InputRange>(range)),
|
||||||
pred
|
pred
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<InputRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -13,32 +13,32 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// find_intersection
|
// find_intersection
|
||||||
//
|
//
|
||||||
template<typename Range1, typename Range2, typename Compare>
|
template<typename InputRange1, typename InputRange2, typename Compare>
|
||||||
inline SPROUT_CONSTEXPR sprout::pair<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||||
typename sprout::range::lvalue_iterator<Range2>::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(
|
return sprout::find_intersection(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2)),
|
sprout::end(sprout::forward<InputRange2>(range2)),
|
||||||
comp
|
comp
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Range1, typename Range2>
|
template<typename InputRange1, typename InputRange2>
|
||||||
inline SPROUT_CONSTEXPR sprout::pair<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||||
typename sprout::range::lvalue_iterator<Range2>::type
|
typename sprout::range::lvalue_iterator<InputRange2>::type
|
||||||
>
|
>
|
||||||
find_intersection(Range1&& range1, Range2&& range2) {
|
find_intersection(InputRange1&& range1, InputRange2&& range2) {
|
||||||
return sprout::find_intersection(
|
return sprout::find_intersection(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2))
|
sprout::end(sprout::forward<InputRange2>(range2))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -13,32 +13,32 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// find_symmetric_difference
|
// find_symmetric_difference
|
||||||
//
|
//
|
||||||
template<typename Range1, typename Range2, typename Compare>
|
template<typename InputRange1, typename InputRange2, typename Compare>
|
||||||
inline SPROUT_CONSTEXPR sprout::pair<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||||
typename sprout::range::lvalue_iterator<Range2>::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(
|
return sprout::find_symmetric_difference(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2)),
|
sprout::end(sprout::forward<InputRange2>(range2)),
|
||||||
comp
|
comp
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Range1, typename Range2>
|
template<typename InputRange1, typename InputRange2>
|
||||||
inline SPROUT_CONSTEXPR sprout::pair<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||||
typename sprout::range::lvalue_iterator<Range2>::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(
|
return sprout::find_symmetric_difference(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2))
|
sprout::end(sprout::forward<InputRange2>(range2))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,15 +10,15 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.4.5.1 includes
|
// 25.4.5.1 includes
|
||||||
template<typename Range1, typename Range2>
|
template<typename InputRange1, typename InputRange2>
|
||||||
inline SPROUT_CONSTEXPR bool
|
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));
|
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
|
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);
|
return sprout::includes(sprout::begin(range1), sprout::end(range1), sprout::begin(range2), sprout::end(range2), comp);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// is_decreasing
|
// is_decreasing
|
||||||
//
|
//
|
||||||
template<typename Range>
|
template<typename ForwardRange>
|
||||||
inline SPROUT_CONSTEXPR bool
|
inline SPROUT_CONSTEXPR bool
|
||||||
is_decreasing(Range const& range) {
|
is_decreasing(ForwardRange const& range) {
|
||||||
return sprout::is_decreasing(sprout::begin(range), sprout::end(range));
|
return sprout::is_decreasing(sprout::begin(range), sprout::end(range));
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,15 +10,15 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.4.6.5 is_heap
|
// 25.4.6.5 is_heap
|
||||||
template<typename Range>
|
template<typename RandomAccessRange>
|
||||||
inline SPROUT_CONSTEXPR bool
|
inline SPROUT_CONSTEXPR bool
|
||||||
is_heap(Range const& range) {
|
is_heap(RandomAccessRange const& range) {
|
||||||
return sprout::is_heap(sprout::begin(range), sprout::end(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
|
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);
|
return sprout::is_heap(sprout::begin(range), sprout::end(range), comp);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -12,53 +12,53 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.4.6.5 is_heap
|
// 25.4.6.5 is_heap
|
||||||
template<typename Range>
|
template<typename RandomAccessRange>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<RandomAccessRange>::type
|
||||||
is_heap_until(Range&& range) {
|
is_heap_until(RandomAccessRange&& range) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<RandomAccessRange>::pack(
|
||||||
sprout::is_heap_until(
|
sprout::is_heap_until(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<RandomAccessRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range))
|
sprout::end(sprout::forward<RandomAccessRange>(range))
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<RandomAccessRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Range, typename Compare>
|
template<typename RandomAccessRange, typename Compare>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<RandomAccessRange>::type
|
||||||
is_heap_until(Range&& range, Compare comp) {
|
is_heap_until(RandomAccessRange&& range, Compare comp) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<RandomAccessRange>::pack(
|
||||||
sprout::is_heap_until(
|
sprout::is_heap_until(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<RandomAccessRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<RandomAccessRange>(range)),
|
||||||
comp
|
comp
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<RandomAccessRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<sprout::range::range_return_value RetV, typename Range>
|
template<sprout::range::range_return_value RetV, typename RandomAccessRange>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<RandomAccessRange, RetV>::type
|
||||||
is_heap_until(Range&& range) {
|
is_heap_until(RandomAccessRange&& range) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<RandomAccessRange, RetV>::pack(
|
||||||
sprout::is_heap_until(
|
sprout::is_heap_until(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<RandomAccessRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(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>
|
template<sprout::range::range_return_value RetV, typename RandomAccessRange, typename Compare>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<RandomAccessRange, RetV>::type
|
||||||
is_heap_until(Range&& range, Compare comp) {
|
is_heap_until(RandomAccessRange&& range, Compare comp) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<RandomAccessRange, RetV>::pack(
|
||||||
sprout::is_heap_until(
|
sprout::is_heap_until(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<RandomAccessRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<RandomAccessRange>(range)),
|
||||||
comp
|
comp
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<RandomAccessRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// is_increasing
|
// is_increasing
|
||||||
//
|
//
|
||||||
template<typename Range>
|
template<typename ForwardRange>
|
||||||
inline SPROUT_CONSTEXPR bool
|
inline SPROUT_CONSTEXPR bool
|
||||||
is_increasing(Range const& range) {
|
is_increasing(ForwardRange const& range) {
|
||||||
return sprout::is_increasing(sprout::begin(range), sprout::end(range));
|
return sprout::is_increasing(sprout::begin(range), sprout::end(range));
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.3.13 partitions
|
// 25.3.13 partitions
|
||||||
template<typename Range, typename Predicate>
|
template<typename InputRange, typename Predicate>
|
||||||
inline SPROUT_CONSTEXPR bool
|
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);
|
return sprout::is_partitioned(sprout::begin(range), sprout::end(range), pred);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,15 +10,15 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.2.12 Is permutation
|
// 25.2.12 Is permutation
|
||||||
template<typename Range1, typename Range2>
|
template<typename ForwardRange1, typename ForwardRange2>
|
||||||
inline SPROUT_CONSTEXPR bool
|
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));
|
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
|
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);
|
return sprout::is_permutation(sprout::begin(range1), sprout::end(range1), sprout::begin(range2), pred);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,15 +10,15 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.4.1.5 is_sorted
|
// 25.4.1.5 is_sorted
|
||||||
template<typename Range>
|
template<typename ForwardRange>
|
||||||
inline SPROUT_CONSTEXPR bool
|
inline SPROUT_CONSTEXPR bool
|
||||||
is_sorted(Range const& range) {
|
is_sorted(ForwardRange const& range) {
|
||||||
return sprout::is_sorted(sprout::begin(range), sprout::end(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
|
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);
|
return sprout::is_sorted(sprout::begin(range), sprout::end(range), comp);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -12,53 +12,53 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.4.1.5 is_sorted
|
// 25.4.1.5 is_sorted
|
||||||
template<typename Range>
|
template<typename ForwardRange>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
is_sorted_until(Range&& range) {
|
is_sorted_until(ForwardRange&& range) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
sprout::is_sorted_until(
|
sprout::is_sorted_until(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(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 typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
is_sorted_until(Range&& range, Compare comp) {
|
is_sorted_until(ForwardRange&& range, Compare comp) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
sprout::is_sorted_until(
|
sprout::is_sorted_until(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
comp
|
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 typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
is_sorted_until(Range&& range) {
|
is_sorted_until(ForwardRange&& range) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
sprout::is_sorted_until(
|
sprout::is_sorted_until(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(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 typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
is_sorted_until(Range&& range, Compare comp) {
|
is_sorted_until(ForwardRange&& range, Compare comp) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
sprout::is_sorted_until(
|
sprout::is_sorted_until(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
comp
|
comp
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// is_strictly_decreasing
|
// is_strictly_decreasing
|
||||||
//
|
//
|
||||||
template<typename Range>
|
template<typename ForwardRange>
|
||||||
inline SPROUT_CONSTEXPR bool
|
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));
|
return sprout::is_strictly_decreasing(sprout::begin(range), sprout::end(range));
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// is_strictly_increasing
|
// is_strictly_increasing
|
||||||
//
|
//
|
||||||
template<typename Range>
|
template<typename ForwardRange>
|
||||||
inline SPROUT_CONSTEXPR bool
|
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));
|
return sprout::is_strictly_increasing(sprout::begin(range), sprout::end(range));
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,17 +10,17 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.4.8 Lexicographical comparison
|
// 25.4.8 Lexicographical comparison
|
||||||
template<typename Range1, typename Range2>
|
template<typename InputRange1, typename InputRange2>
|
||||||
inline SPROUT_CONSTEXPR bool
|
inline SPROUT_CONSTEXPR bool
|
||||||
lexicographical_compare(Range1 const& range1, Range2 const& range2) {
|
lexicographical_compare(InputRange1 const& range1, InputRange2 const& range2) {
|
||||||
return sprout::lexicographical_compare(
|
return sprout::lexicographical_compare(
|
||||||
sprout::begin(range1), sprout::end(range1), sprout::begin(range2), sprout::end(range2)
|
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
|
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(
|
return sprout::lexicographical_compare(
|
||||||
sprout::begin(range1), sprout::end(range1), sprout::begin(range2), sprout::end(range2), comp
|
sprout::begin(range1), sprout::end(range1), sprout::begin(range2), sprout::end(range2), comp
|
||||||
);
|
);
|
||||||
|
|
|
@ -12,57 +12,57 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.4.3.1 lower_bound
|
// 25.4.3.1 lower_bound
|
||||||
template<typename Range, typename T>
|
template<typename ForwardRange, typename T>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
lower_bound(Range&& range, T const& value) {
|
lower_bound(ForwardRange&& range, T const& value) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
sprout::lower_bound(
|
sprout::lower_bound(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
value
|
value
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Range, typename T, typename Compare>
|
template<typename ForwardRange, typename T, typename Compare>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
lower_bound(Range&& range, T const& value, Compare comp) {
|
lower_bound(ForwardRange&& range, T const& value, Compare comp) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
sprout::lower_bound(
|
sprout::lower_bound(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
value,
|
value,
|
||||||
comp
|
comp
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<sprout::range::range_return_value RetV, typename Range, typename T>
|
template<sprout::range::range_return_value RetV, typename ForwardRange, typename T>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
lower_bound(Range&& range, T const& value) {
|
lower_bound(ForwardRange&& range, T const& value) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
sprout::lower_bound(
|
sprout::lower_bound(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
value
|
value
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<sprout::range::range_return_value RetV, typename Range, typename T, typename Compare>
|
template<sprout::range::range_return_value RetV, typename ForwardRange, typename T, typename Compare>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
lower_bound(Range&& range, T const& value, Compare comp) {
|
lower_bound(ForwardRange&& range, T const& value, Compare comp) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
sprout::lower_bound(
|
sprout::lower_bound(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
value,
|
value,
|
||||||
comp
|
comp
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -12,53 +12,53 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.4.7 Minimum and maximum
|
// 25.4.7 Minimum and maximum
|
||||||
template<typename Range>
|
template<typename ForwardRange>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
max_element(Range&& range) {
|
max_element(ForwardRange&& range) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
sprout::max_element(
|
sprout::max_element(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(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 typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
max_element(Range&& range, Compare comp) {
|
max_element(ForwardRange&& range, Compare comp) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
sprout::max_element(
|
sprout::max_element(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
comp
|
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 typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
max_element(Range&& range) {
|
max_element(ForwardRange&& range) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
sprout::max_element(
|
sprout::max_element(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(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 typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
max_element(Range&& range, Compare comp) {
|
max_element(ForwardRange&& range, Compare comp) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
sprout::max_element(
|
sprout::max_element(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
comp
|
comp
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -12,53 +12,53 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.4.7 Minimum and maximum
|
// 25.4.7 Minimum and maximum
|
||||||
template<typename Range>
|
template<typename ForwardRange>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
min_element(Range&& range) {
|
min_element(ForwardRange&& range) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
sprout::min_element(
|
sprout::min_element(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(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 typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
min_element(Range&& range, Compare comp) {
|
min_element(ForwardRange&& range, Compare comp) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
sprout::min_element(
|
sprout::min_element(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
comp
|
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 typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
min_element(Range&& range) {
|
min_element(ForwardRange&& range) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
sprout::min_element(
|
sprout::min_element(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(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 typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
min_element(Range&& range, Compare comp) {
|
min_element(ForwardRange&& range, Compare comp) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
sprout::min_element(
|
sprout::min_element(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
comp
|
comp
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -11,27 +11,27 @@
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace range {
|
namespace range {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
template<typename Range, typename Pair>
|
template<typename ForwardRange, typename Pair>
|
||||||
inline SPROUT_CONSTEXPR sprout::pair<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::range_return<Range>::type,
|
typename sprout::range::range_return<ForwardRange>::type,
|
||||||
typename sprout::range::range_return<Range>::type
|
typename sprout::range::range_return<ForwardRange>::type
|
||||||
>
|
>
|
||||||
pack_pair(Pair const& pair, Range&& range) {
|
pack_pair(Pair const& pair, ForwardRange&& range) {
|
||||||
return {
|
return {
|
||||||
sprout::range::range_return<Range>::pack(pair.first, sprout::forward<Range>(range)),
|
sprout::range::range_return<ForwardRange>::pack(pair.first, sprout::forward<ForwardRange>(range)),
|
||||||
sprout::range::range_return<Range>::pack(pair.second, sprout::forward<Range>(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<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::range_return<Range, RetV>::type,
|
typename sprout::range::range_return<ForwardRange, RetV>::type,
|
||||||
typename sprout::range::range_return<Range, 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 {
|
return {
|
||||||
sprout::range::range_return<Range, RetV>::pack(pair.first, sprout::forward<Range>(range)),
|
sprout::range::range_return<ForwardRange, RetV>::pack(pair.first, sprout::forward<ForwardRange>(range)),
|
||||||
sprout::range::range_return<Range, RetV>::pack(pair.second, sprout::forward<Range>(range))
|
sprout::range::range_return<ForwardRange, RetV>::pack(pair.second, sprout::forward<ForwardRange>(range))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
@ -39,65 +39,65 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.4.7 Minimum and maximum
|
// 25.4.7 Minimum and maximum
|
||||||
template<typename Range>
|
template<typename ForwardRange>
|
||||||
inline SPROUT_CONSTEXPR sprout::pair<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::range_return<Range>::type,
|
typename sprout::range::range_return<ForwardRange>::type,
|
||||||
typename sprout::range::range_return<Range>::type
|
typename sprout::range::range_return<ForwardRange>::type
|
||||||
>
|
>
|
||||||
minmax_element(Range&& range) {
|
minmax_element(ForwardRange&& range) {
|
||||||
return sprout::range::detail::pack_pair<Range>(
|
return sprout::range::detail::pack_pair<ForwardRange>(
|
||||||
sprout::minmax_element(
|
sprout::minmax_element(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(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<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::range_return<Range>::type,
|
typename sprout::range::range_return<ForwardRange>::type,
|
||||||
typename sprout::range::range_return<Range>::type
|
typename sprout::range::range_return<ForwardRange>::type
|
||||||
>
|
>
|
||||||
minmax_element(Range&& range, Compare comp) {
|
minmax_element(ForwardRange&& range, Compare comp) {
|
||||||
return sprout::range::detail::pack_pair<Range>(
|
return sprout::range::detail::pack_pair<ForwardRange>(
|
||||||
sprout::minmax_element(
|
sprout::minmax_element(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
comp
|
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<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::range_return<Range, RetV>::type,
|
typename sprout::range::range_return<ForwardRange, RetV>::type,
|
||||||
typename sprout::range::range_return<Range, RetV>::type
|
typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
>
|
>
|
||||||
minmax_element(Range&& range) {
|
minmax_element(ForwardRange&& range) {
|
||||||
return sprout::range::detail::pack_pair<RetV, Range>(
|
return sprout::range::detail::pack_pair<RetV, ForwardRange>(
|
||||||
sprout::minmax_element(
|
sprout::minmax_element(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(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<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::range_return<Range, RetV>::type,
|
typename sprout::range::range_return<ForwardRange, RetV>::type,
|
||||||
typename sprout::range::range_return<Range, RetV>::type
|
typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
>
|
>
|
||||||
minmax_element(Range&& range, Compare comp) {
|
minmax_element(ForwardRange&& range, Compare comp) {
|
||||||
return sprout::range::detail::pack_pair<RetV, Range>(
|
return sprout::range::detail::pack_pair<RetV, ForwardRange>(
|
||||||
sprout::minmax_element(
|
sprout::minmax_element(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
comp
|
comp
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -13,29 +13,29 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.2.10 Mismatch
|
// 25.2.10 Mismatch
|
||||||
template<typename Range1, typename Range2>
|
template<typename InputRange1, typename InputRange2>
|
||||||
inline SPROUT_CONSTEXPR sprout::pair<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||||
typename sprout::range::lvalue_iterator<Range2>::type
|
typename sprout::range::lvalue_iterator<InputRange2>::type
|
||||||
>
|
>
|
||||||
mismatch(Range1&& range1, Range2&& range2) {
|
mismatch(InputRange1&& range1, InputRange2&& range2) {
|
||||||
return sprout::mismatch(
|
return sprout::mismatch(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2))
|
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<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||||
typename sprout::range::lvalue_iterator<Range2>::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(
|
return sprout::mismatch(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||||
pred
|
pred
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,32 +13,32 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// next_difference
|
// next_difference
|
||||||
//
|
//
|
||||||
template<typename Range1, typename Range2, typename Compare>
|
template<typename InputRange1, typename InputRange2, typename Compare>
|
||||||
inline SPROUT_CONSTEXPR sprout::pair<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||||
typename sprout::range::lvalue_iterator<Range2>::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(
|
return sprout::next_difference(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2)),
|
sprout::end(sprout::forward<InputRange2>(range2)),
|
||||||
comp
|
comp
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Range1, typename Range2>
|
template<typename InputRange1, typename InputRange2>
|
||||||
inline SPROUT_CONSTEXPR sprout::pair<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||||
typename sprout::range::lvalue_iterator<Range2>::type
|
typename sprout::range::lvalue_iterator<InputRange2>::type
|
||||||
>
|
>
|
||||||
next_difference(Range1&& range1, Range2&& range2) {
|
next_difference(InputRange1&& range1, InputRange2&& range2) {
|
||||||
return sprout::next_difference(
|
return sprout::next_difference(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2))
|
sprout::end(sprout::forward<InputRange2>(range2))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -13,32 +13,32 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// next_intersection
|
// next_intersection
|
||||||
//
|
//
|
||||||
template<typename Range1, typename Range2, typename Compare>
|
template<typename InputRange1, typename InputRange2, typename Compare>
|
||||||
inline SPROUT_CONSTEXPR sprout::pair<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||||
typename sprout::range::lvalue_iterator<Range2>::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(
|
return sprout::next_intersection(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2)),
|
sprout::end(sprout::forward<InputRange2>(range2)),
|
||||||
comp
|
comp
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Range1, typename Range2>
|
template<typename InputRange1, typename InputRange2>
|
||||||
inline SPROUT_CONSTEXPR sprout::pair<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||||
typename sprout::range::lvalue_iterator<Range2>::type
|
typename sprout::range::lvalue_iterator<InputRange2>::type
|
||||||
>
|
>
|
||||||
next_intersection(Range1&& range1, Range2&& range2) {
|
next_intersection(InputRange1&& range1, InputRange2&& range2) {
|
||||||
return sprout::next_intersection(
|
return sprout::next_intersection(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2))
|
sprout::end(sprout::forward<InputRange2>(range2))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -13,32 +13,32 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// next_union
|
// next_union
|
||||||
//
|
//
|
||||||
template<typename Range1, typename Range2, typename Compare>
|
template<typename InputRange1, typename InputRange2, typename Compare>
|
||||||
inline SPROUT_CONSTEXPR sprout::pair<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||||
typename sprout::range::lvalue_iterator<Range2>::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(
|
return sprout::next_union(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2)),
|
sprout::end(sprout::forward<InputRange2>(range2)),
|
||||||
comp
|
comp
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Range1, typename Range2>
|
template<typename InputRange1, typename InputRange2>
|
||||||
inline SPROUT_CONSTEXPR sprout::pair<
|
inline SPROUT_CONSTEXPR sprout::pair<
|
||||||
typename sprout::range::lvalue_iterator<Range1>::type,
|
typename sprout::range::lvalue_iterator<InputRange1>::type,
|
||||||
typename sprout::range::lvalue_iterator<Range2>::type
|
typename sprout::range::lvalue_iterator<InputRange2>::type
|
||||||
>
|
>
|
||||||
next_union(Range1&& range1, Range2&& range2) {
|
next_union(InputRange1&& range1, InputRange2&& range2) {
|
||||||
return sprout::next_union(
|
return sprout::next_union(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<InputRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<InputRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2))
|
sprout::end(sprout::forward<InputRange2>(range2))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.2.3 None of
|
// 25.2.3 None of
|
||||||
template<typename Range, typename Predicate>
|
template<typename InputRange, typename Predicate>
|
||||||
inline SPROUT_CONSTEXPR bool
|
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);
|
return sprout::none_of(sprout::begin(range), sprout::end(range), pred);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// none_of_equal
|
// none_of_equal
|
||||||
//
|
//
|
||||||
template<typename Range, typename T>
|
template<typename InputRange, typename T>
|
||||||
inline SPROUT_CONSTEXPR bool
|
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);
|
return sprout::none_of_equal(sprout::begin(range), sprout::end(range), value);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// one_of
|
// one_of
|
||||||
//
|
//
|
||||||
template<typename Range, typename Predicate>
|
template<typename InputRange, typename Predicate>
|
||||||
inline SPROUT_CONSTEXPR bool
|
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);
|
return sprout::one_of(sprout::begin(range), sprout::end(range), pred);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,9 +10,9 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// one_of_equal
|
// one_of_equal
|
||||||
//
|
//
|
||||||
template<typename Range, typename T>
|
template<typename InputRange, typename T>
|
||||||
inline SPROUT_CONSTEXPR bool
|
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);
|
return sprout::one_of_equal(sprout::begin(range), sprout::end(range), value);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -12,16 +12,16 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.3.13 partitions
|
// 25.3.13 partitions
|
||||||
template<typename Range, typename Predicate>
|
template<typename ForwardRange, typename Predicate>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
partition_point(Range&& range, Predicate pred) {
|
partition_point(ForwardRange&& range, Predicate pred) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
sprout::partition_point(
|
sprout::partition_point(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
pred
|
pred
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -12,61 +12,61 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.2.13 Search
|
// 25.2.13 Search
|
||||||
template<typename Range1, typename Range2>
|
template<typename ForwardRange1, typename ForwardRange2>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange1>::type
|
||||||
search(Range1&& range1, Range2&& range2) {
|
search(ForwardRange1&& range1, ForwardRange2&& range2) {
|
||||||
return sprout::range::range_return<Range1>::pack(
|
return sprout::range::range_return<ForwardRange1>::pack(
|
||||||
sprout::search(
|
sprout::search(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<ForwardRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<ForwardRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<ForwardRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2))
|
sprout::end(sprout::forward<ForwardRange2>(range2))
|
||||||
),
|
),
|
||||||
sprout::forward<Range1>(range1)
|
sprout::forward<ForwardRange1>(range1)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Range1, typename Range2, typename BinaryPredicate>
|
template<typename ForwardRange1, typename ForwardRange2, typename BinaryPredicate>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange1>::type
|
||||||
search(Range1&& range1, Range2&& range2, BinaryPredicate pred) {
|
search(ForwardRange1&& range1, ForwardRange2&& range2, BinaryPredicate pred) {
|
||||||
return sprout::range::range_return<Range1>::pack(
|
return sprout::range::range_return<ForwardRange1>::pack(
|
||||||
sprout::search(
|
sprout::search(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<ForwardRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<ForwardRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<ForwardRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2)),
|
sprout::end(sprout::forward<ForwardRange2>(range2)),
|
||||||
pred
|
pred
|
||||||
),
|
),
|
||||||
sprout::forward<Range1>(range1)
|
sprout::forward<ForwardRange1>(range1)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<sprout::range::range_return_value RetV, typename Range1, typename Range2>
|
template<sprout::range::range_return_value RetV, typename ForwardRange1, typename ForwardRange2>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange1, RetV>::type
|
||||||
search(Range1&& range1, Range2&& range2) {
|
search(ForwardRange1&& range1, ForwardRange2&& range2) {
|
||||||
return sprout::range::range_return<Range1, RetV>::pack(
|
return sprout::range::range_return<ForwardRange1, RetV>::pack(
|
||||||
sprout::search(
|
sprout::search(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<ForwardRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<ForwardRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<ForwardRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(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>
|
template<sprout::range::range_return_value RetV, typename ForwardRange1, typename ForwardRange2, typename BinaryPredicate>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range1, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange1, RetV>::type
|
||||||
search(Range1&& range1, Range2&& range2, BinaryPredicate pred) {
|
search(ForwardRange1&& range1, ForwardRange2&& range2, BinaryPredicate pred) {
|
||||||
return sprout::range::range_return<Range1, RetV>::pack(
|
return sprout::range::range_return<ForwardRange1, RetV>::pack(
|
||||||
sprout::search(
|
sprout::search(
|
||||||
sprout::begin(sprout::forward<Range1>(range1)),
|
sprout::begin(sprout::forward<ForwardRange1>(range1)),
|
||||||
sprout::end(sprout::forward<Range1>(range1)),
|
sprout::end(sprout::forward<ForwardRange1>(range1)),
|
||||||
sprout::begin(sprout::forward<Range2>(range2)),
|
sprout::begin(sprout::forward<ForwardRange2>(range2)),
|
||||||
sprout::end(sprout::forward<Range2>(range2)),
|
sprout::end(sprout::forward<ForwardRange2>(range2)),
|
||||||
pred
|
pred
|
||||||
),
|
),
|
||||||
sprout::forward<Range1>(range1)
|
sprout::forward<ForwardRange1>(range1)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -12,61 +12,61 @@ namespace sprout {
|
||||||
// Copyright (C) 2011 RiSK (sscrisk)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.2.13 Search
|
// 25.2.13 Search
|
||||||
template<typename Range, typename Size, typename T>
|
template<typename ForwardRange, typename Size, typename T>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
search_n(Range&& range, Size count, T const& value) {
|
search_n(ForwardRange&& range, Size count, T const& value) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
sprout::search_n(
|
sprout::search_n(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
count,
|
count,
|
||||||
value
|
value
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Range, typename Size, typename T, typename BinaryPredicate>
|
template<typename ForwardRange, typename Size, typename T, typename BinaryPredicate>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
search_n(Range&& range, Size count, T const& value, BinaryPredicate pred) {
|
search_n(ForwardRange&& range, Size count, T const& value, BinaryPredicate pred) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
sprout::search_n(
|
sprout::search_n(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
count,
|
count,
|
||||||
value,
|
value,
|
||||||
pred
|
pred
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<sprout::range::range_return_value RetV, typename Range, typename Size, typename T>
|
template<sprout::range::range_return_value RetV, typename ForwardRange, typename Size, typename T>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
search_n(Range&& range, Size count, T const& value) {
|
search_n(ForwardRange&& range, Size count, T const& value) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
sprout::search_n(
|
sprout::search_n(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
count,
|
count,
|
||||||
value
|
value
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<sprout::range::range_return_value RetV, typename Range, typename Size, typename T, typename BinaryPredicate>
|
template<sprout::range::range_return_value RetV, typename ForwardRange, typename Size, typename T, typename BinaryPredicate>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
search_n(Range&& range, Size count, T const& value, BinaryPredicate pred) {
|
search_n(ForwardRange&& range, Size count, T const& value, BinaryPredicate pred) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
sprout::search_n(
|
sprout::search_n(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
count,
|
count,
|
||||||
value,
|
value,
|
||||||
pred
|
pred
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -10,33 +10,33 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// tristate_lexicographical_compare
|
// tristate_lexicographical_compare
|
||||||
//
|
//
|
||||||
template<typename Range1, typename Range2>
|
template<typename InputRange1, typename InputRange2>
|
||||||
inline SPROUT_CONSTEXPR int
|
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(
|
return sprout::tristate_lexicographical_compare(
|
||||||
sprout::begin(range1), sprout::end(range1), sprout::begin(range2), sprout::end(range2)
|
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
|
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(
|
return sprout::tristate_lexicographical_compare(
|
||||||
sprout::begin(range1), sprout::end(range1), sprout::begin(range2), sprout::end(range2), comp
|
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
|
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(
|
return sprout::tristate_lexicographical_compare(
|
||||||
sprout::begin(range1), sprout::end(range1), delim1, sprout::begin(range2), sprout::end(range2), delim2
|
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
|
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(
|
return sprout::tristate_lexicographical_compare(
|
||||||
sprout::begin(range1), sprout::end(range1), delim1, sprout::begin(range2), sprout::end(range2), delim2, comp
|
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)
|
// Copyright (C) 2011 RiSK (sscrisk)
|
||||||
|
|
||||||
// 25.4.3.2 upper_bound
|
// 25.4.3.2 upper_bound
|
||||||
template<typename Range, typename T>
|
template<typename ForwardRange, typename T>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
upper_bound(Range&& range, T const& value) {
|
upper_bound(ForwardRange&& range, T const& value) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
sprout::upper_bound(
|
sprout::upper_bound(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
value
|
value
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Range, typename T, typename Compare>
|
template<typename ForwardRange, typename T, typename Compare>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
upper_bound(Range&& range, T const& value, Compare comp) {
|
upper_bound(ForwardRange&& range, T const& value, Compare comp) {
|
||||||
return sprout::range::range_return<Range>::pack(
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
sprout::upper_bound(
|
sprout::upper_bound(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
value,
|
value,
|
||||||
comp
|
comp
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<sprout::range::range_return_value RetV, typename Range, typename T>
|
template<sprout::range::range_return_value RetV, typename ForwardRange, typename T>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
upper_bound(Range&& range, T const& value) {
|
upper_bound(ForwardRange&& range, T const& value) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
sprout::upper_bound(
|
sprout::upper_bound(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
value
|
value
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<sprout::range::range_return_value RetV, typename Range, typename T, typename Compare>
|
template<sprout::range::range_return_value RetV, typename ForwardRange, typename T, typename Compare>
|
||||||
inline SPROUT_CONSTEXPR typename sprout::range::range_return<Range, RetV>::type
|
inline SPROUT_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
upper_bound(Range&& range, T const& value, Compare comp) {
|
upper_bound(ForwardRange&& range, T const& value, Compare comp) {
|
||||||
return sprout::range::range_return<Range, RetV>::pack(
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
sprout::upper_bound(
|
sprout::upper_bound(
|
||||||
sprout::begin(sprout::forward<Range>(range)),
|
sprout::begin(sprout::forward<ForwardRange>(range)),
|
||||||
sprout::end(sprout::forward<Range>(range)),
|
sprout::end(sprout::forward<ForwardRange>(range)),
|
||||||
value,
|
value,
|
||||||
comp
|
comp
|
||||||
),
|
),
|
||||||
sprout::forward<Range>(range)
|
sprout::forward<ForwardRange>(range)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -7,15 +7,15 @@
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace range {
|
namespace range {
|
||||||
// 26.7.2 Accumulate
|
// 26.7.2 Accumulate
|
||||||
template<typename Range, typename T, typename BinaryOperation>
|
template<typename InputRange, typename T, typename BinaryOperation>
|
||||||
inline SPROUT_CONSTEXPR T
|
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);
|
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
|
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);
|
return sprout::accumulate(sprout::begin(range), sprout::end(range), init);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -7,19 +7,19 @@
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace range {
|
namespace range {
|
||||||
// 26.7.3 Inner product
|
// 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
|
inline SPROUT_CONSTEXPR T
|
||||||
inner_product(
|
inner_product(
|
||||||
Range1 const& range1, Range2 const& range2, T init,
|
InputRange1 const& range1, InputRange2 const& range2, T init,
|
||||||
BinaryOperation1 binary_op1, BinaryOperation2 binary_op2
|
BinaryOperation1 binary_op1, BinaryOperation2 binary_op2
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return sprout::inner_product(sprout::begin(range1), sprout::end(range1), sprout::begin(range2), init, binary_op1, 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
|
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);
|
return sprout::inner_product(sprout::begin(range1), sprout::end(range1), sprout::begin(range2), init);
|
||||||
}
|
}
|
||||||
} // namespace range
|
} // namespace range
|
||||||
|
|
|
@ -21,16 +21,16 @@ namespace sprout {
|
||||||
public:
|
public:
|
||||||
typedef sprout::uuids::uuid result_type;
|
typedef sprout::uuids::uuid result_type;
|
||||||
private:
|
private:
|
||||||
template<typename Iterator>
|
template<typename ForwardIterator>
|
||||||
struct next_char {
|
struct next_char {
|
||||||
public:
|
public:
|
||||||
typedef typename std::iterator_traits<Iterator>::value_type char_type;
|
typedef typename std::iterator_traits<ForwardIterator>::value_type char_type;
|
||||||
public:
|
public:
|
||||||
char_type c;
|
char_type c;
|
||||||
Iterator first;
|
ForwardIterator first;
|
||||||
Iterator last;
|
ForwardIterator last;
|
||||||
public:
|
public:
|
||||||
SPROUT_CONSTEXPR next_char(Iterator f, Iterator l)
|
SPROUT_CONSTEXPR next_char(ForwardIterator f, ForwardIterator l)
|
||||||
: c(f != l
|
: c(f != l
|
||||||
? *f
|
? *f
|
||||||
: throw std::runtime_error("string_generator: invalid uuid string (out of range)")
|
: 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) {
|
static SPROUT_CONSTEXPR bool is_close_brace(char32_t c, char open_brace) {
|
||||||
return open_brace == U'{' && c == U'}';
|
return open_brace == U'{' && c == U'}';
|
||||||
}
|
}
|
||||||
template<typename Iterator, typename Char, typename... Args>
|
template<typename ForwardIterator, typename Char, typename... Args>
|
||||||
SPROUT_CONSTEXPR result_type
|
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)));
|
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
|
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...);
|
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<
|
SPROUT_CONSTEXPR typename std::enable_if<
|
||||||
sizeof...(Args) == 6 || sizeof...(Args) == 8 || sizeof...(Args) == 10,
|
sizeof...(Args) == 6 || sizeof...(Args) == 8 || sizeof...(Args) == 10,
|
||||||
result_type
|
result_type
|
||||||
>::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
|
return has_dashes
|
||||||
? is_dash(nc.c)
|
? is_dash(nc.c)
|
||||||
? generate_2_2(nc.next(), open_brace, has_dashes, args...)
|
? 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...)
|
: 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<
|
SPROUT_CONSTEXPR typename std::enable_if<
|
||||||
sizeof...(Args) == 4,
|
sizeof...(Args) == 4,
|
||||||
result_type
|
result_type
|
||||||
>::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)
|
return is_dash(nc.c)
|
||||||
? generate_2_2(nc.next(), open_brace, true, args...)
|
? generate_2_2(nc.next(), open_brace, true, args...)
|
||||||
: generate_2_2(nc, open_brace, false, 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<
|
SPROUT_CONSTEXPR typename std::enable_if<
|
||||||
sizeof...(Args) != 4 && sizeof...(Args) != 6 && sizeof...(Args) != 8 && sizeof...(Args) != 10,
|
sizeof...(Args) != 4 && sizeof...(Args) != 6 && sizeof...(Args) != 8 && sizeof...(Args) != 10,
|
||||||
result_type
|
result_type
|
||||||
>::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...);
|
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<
|
SPROUT_CONSTEXPR typename std::enable_if<
|
||||||
sizeof...(Args) == 16,
|
sizeof...(Args) == 16,
|
||||||
result_type
|
result_type
|
||||||
>::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))
|
return !open_brace || (open_brace && is_close_brace(nc.next().c, open_brace))
|
||||||
? result_type{{args...}}
|
? result_type{{args...}}
|
||||||
: throw std::runtime_error("string_generator: invalid uuid string (brace not closed)")
|
: 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<
|
SPROUT_CONSTEXPR typename std::enable_if<
|
||||||
sizeof...(Args) == 0,
|
sizeof...(Args) == 0,
|
||||||
result_type
|
result_type
|
||||||
>::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...);
|
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<
|
SPROUT_CONSTEXPR typename std::enable_if<
|
||||||
sizeof...(Args) != 0 && sizeof...(Args) != 16,
|
sizeof...(Args) != 0 && sizeof...(Args) != 16,
|
||||||
result_type
|
result_type
|
||||||
>::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...);
|
return generate_2_1(nc.next(), open_brace, has_dashes, args...);
|
||||||
}
|
}
|
||||||
template<typename Iterator>
|
template<typename ForwardIterator>
|
||||||
SPROUT_CONSTEXPR result_type
|
SPROUT_CONSTEXPR result_type
|
||||||
generate_1(next_char<Iterator> nc) const {
|
generate_1(next_char<ForwardIterator> nc) const {
|
||||||
return is_open_brace(nc.c)
|
return is_open_brace(nc.c)
|
||||||
? generate_2(nc.next(), nc.c, false)
|
? 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:
|
public:
|
||||||
template<typename Iterator>
|
template<typename ForwardIterator>
|
||||||
SPROUT_CONSTEXPR result_type operator()(Iterator first, Iterator last) const {
|
SPROUT_CONSTEXPR result_type operator()(ForwardIterator first, ForwardIterator last) const {
|
||||||
return generate_1(next_char<Iterator>(first, last));
|
return generate_1(next_char<ForwardIterator>(first, last));
|
||||||
}
|
}
|
||||||
template<typename Elem, std::size_t N, typename Traits>
|
template<typename Elem, std::size_t N, typename Traits>
|
||||||
SPROUT_CONSTEXPR result_type operator()(sprout::basic_string<Elem, N, Traits> const& s) const {
|
SPROUT_CONSTEXPR result_type operator()(sprout::basic_string<Elem, N, Traits> const& s) const {
|
||||||
|
@ -201,9 +201,9 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// make_uuid
|
// make_uuid
|
||||||
//
|
//
|
||||||
template<typename Iterator>
|
template<typename ForwardIterator>
|
||||||
inline SPROUT_CONSTEXPR sprout::uuids::uuid
|
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);
|
return sprout::uuids::string_generator()(first, last);
|
||||||
}
|
}
|
||||||
template<typename Elem, std::size_t N, typename Traits>
|
template<typename Elem, std::size_t N, typename Traits>
|
||||||
|
|
|
@ -116,10 +116,10 @@ namespace sprout {
|
||||||
return sprout::to_string(U"x500");
|
return sprout::to_string(U"x500");
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Range>
|
template<typename InputRange>
|
||||||
inline SPROUT_CONSTEXPR sprout::uuids::md5_name_generator
|
inline SPROUT_CONSTEXPR sprout::uuids::md5_name_generator
|
||||||
uuid3_impl(Range const& rng) {
|
uuid3_impl(InputRange const& rng) {
|
||||||
typedef typename std::decay<typename sprout::containers::value_type<Range>::type>::type value_type;
|
typedef typename std::decay<typename sprout::containers::value_type<InputRange>::type>::type value_type;
|
||||||
typedef sprout::ctypes::nocase_equal_to<value_type> predicate_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()
|
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()
|
: 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
|
inline SPROUT_CONSTEXPR sprout::uuids::sha1_name_generator
|
||||||
uuid5_impl(Range const& rng) {
|
uuid5_impl(InputRange const& rng) {
|
||||||
typedef typename std::decay<typename sprout::containers::value_type<Range>::type>::type value_type;
|
typedef typename std::decay<typename sprout::containers::value_type<InputRange>::type>::type value_type;
|
||||||
typedef sprout::ctypes::nocase_equal_to<value_type> predicate_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()
|
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()
|
: 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)
|
: testspr::equal(first1 + 1, last1, first2 + 1, last2)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
template<typename Range1, typename Range2>
|
template<typename InputRange1, typename InputRange2>
|
||||||
inline SPROUT_CONSTEXPR bool
|
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));
|
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)
|
: testspr::is_found(first + 1, last, value)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
template<typename Range, typename T>
|
template<typename InputRange, typename T>
|
||||||
inline SPROUT_CONSTEXPR bool
|
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);
|
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)
|
: (*first == value ? 1 : 0) + testspr::count(first + 1, last, value)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
template<typename Range, typename T>
|
template<typename InputRange, typename T>
|
||||||
inline SPROUT_CONSTEXPR typename std::iterator_traits<typename Range::const_iterator>::difference_type
|
inline SPROUT_CONSTEXPR typename std::iterator_traits<typename InputRange::const_iterator>::difference_type
|
||||||
count(Range const& range, T const& value) {
|
count(InputRange const& range, T const& value) {
|
||||||
return testspr::count(sprout::begin(range), sprout::end(range), 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);
|
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
|
inline SPROUT_CONSTEXPR bool
|
||||||
is_permutation(Range1 const& range1, Range2 const& range2) {
|
is_permutation(ForwardRange1 const& range1, ForwardRange2 const& range2) {
|
||||||
return testspr::is_permutation(
|
return testspr::is_permutation(
|
||||||
sprout::begin(range1), sprout::end(range1),
|
sprout::begin(range1), sprout::end(range1),
|
||||||
sprout::begin(range2), sprout::end(range2)
|
sprout::begin(range2), sprout::end(range2)
|
||||||
|
|
|
@ -12,13 +12,13 @@ namespace testspr {
|
||||||
//
|
//
|
||||||
// print
|
// print
|
||||||
//
|
//
|
||||||
template<typename Iterator>
|
template<typename InputIterator>
|
||||||
void print(Iterator first, Iterator last) {
|
void print(InputIterator first, InputIterator last) {
|
||||||
std::for_each(first, last, [](typename std::iterator_traits<Iterator>::value_type const& e){ std::cout << e << ' '; });
|
std::for_each(first, last, [](typename std::iterator_traits<InputIterator>::value_type const& e){ std::cout << e << ' '; });
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
}
|
}
|
||||||
template<typename Range>
|
template<typename InputRange>
|
||||||
void print(Range const& range) {
|
void print(InputRange const& range) {
|
||||||
testspr::print(sprout::begin(range), sprout::end(range));
|
testspr::print(sprout::begin(range), sprout::end(range));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue