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

@ -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