1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

add algorithm clamp, clamp_range_copy, clamp_range

This commit is contained in:
bolero-MURAKAMI 2012-10-13 21:06:32 +09:00
parent de41f5c880
commit 79ea4f0885
29 changed files with 870 additions and 11 deletions

View file

@ -47,7 +47,7 @@ namespace sprout {
return sprout::find_if(first, last, pred);
}
static SPROUT_CONSTEXPR iterator_type find_prev(iterator_type first, predicate_type pred) {
return pred(*first) != false ? first
return pred(*first) ? first
: find_prev(sprout::prev(first), pred)
;
}