From 9704d9e777a8e8ed179beb903469760ab77cd18c Mon Sep 17 00:00:00 2001 From: Mitsuru Kariya Date: Sat, 31 Aug 2013 01:08:37 +0900 Subject: [PATCH] [algorithm.upper_bound] Change a bit. --- sprout/algorithm/upper_bound.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sprout/algorithm/upper_bound.hpp b/sprout/algorithm/upper_bound.hpp index 4bc4e129..fdb1ec0b 100644 --- a/sprout/algorithm/upper_bound.hpp +++ b/sprout/algorithm/upper_bound.hpp @@ -27,7 +27,7 @@ namespace sprout { return first == last ? last : sprout::next(first) == last ? !comp(value, *first) ? last : first : !comp(value, *sprout::next(first, sprout::distance(first, last) / 2)) - ? sprout::upper_bound(sprout::next(first, sprout::distance(first, last) / 2), last, value, comp) + ? sprout::upper_bound(sprout::next(first, sprout::distance(first, last) / 2 + 1), last, value, comp) : sprout::upper_bound(first, sprout::next(first, sprout::distance(first, last) / 2), value, comp) ; } @@ -37,7 +37,7 @@ namespace sprout { upper_bound(ForwardIterator first, ForwardIterator last, T const& value) { return sprout::upper_bound( first, last, value, - NS_SSCRISK_CEL_OR_SPROUT::less::value_type>() + NS_SSCRISK_CEL_OR_SPROUT::less<>() ); } } // namespace sprout