On 2007-06-13, desktop <ff*@sss.comwrote:

In section 23.1.2 table 69 upper and lower bound are defined like:

a.lower_bound(k) iterator; logarithmic

returns an iterator pointing to the

first element with key not less than k

a.upper_bound(k) iterator; logarithmic

returns an iterator pointing to the

first element with key greater than k

should "not less" in lower_bound not just be "less"? Or is it supposed

to be interpreted as "greater than or equal"?

The standard is correct. Iterating through the range [lower_bound,

upper_bound) should iterate through elements which "equal" k. "Not

less" is, conceptually, "greater than or equal" so lower_bound is

upper_bound when there is no matching element for k. This meets the

logical requirement that [lower_bound, upper_bound) is empty. If

lower_bound is not the same as upper_bound it implies that there is at

least one element that matches k and [lower_bound, upper_bound)

contains all such elements.