From dea3b94f120e0718598b8870d3c06e8eaf1880b7 Mon Sep 17 00:00:00 2001 From: kugelrund Date: Sat, 26 May 2018 10:03:29 +0200 Subject: [PATCH] Clarify result of lower_bound The previous formulation made it sound like the return value is always `last` if `val` is not in the range, which might lead to confusion. --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 71da7c9..21827fe 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -13160,7 +13160,7 @@ needed information back to the caller. Therefore, the standard library also offe template ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, const T& val); -`lower_bound` returns an iterator to the first match if any, otherwise `last`. +`lower_bound` returns an iterator to the first match if any, otherwise to the first element greater than `val`, or `last` if no such element is found. However, `lower_bound` still doesn't return enough information for all uses, so the standard library also offers