mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-04 14:14:09 +00:00
add algorithm clamp, clamp_range_copy, clamp_range
This commit is contained in:
parent
de41f5c880
commit
79ea4f0885
29 changed files with 870 additions and 11 deletions
|
@ -13,7 +13,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR typename std::iterator_traits<InputIterator>::difference_type
|
||||
count_if(InputIterator first, InputIterator last, Predicate pred) {
|
||||
return first == last ? 0
|
||||
: (pred(*first) != false ? 1 : 0) + sprout::count_if(sprout::next(first), last, pred)
|
||||
: (pred(*first) ? 1 : 0) + sprout::count_if(sprout::next(first), last, pred)
|
||||
;
|
||||
}
|
||||
} // namespace sprout
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue