g*c 发帖数: 4510 | 1 Returns an iterator pointing to the first element in the range [first,last)
which does not compare less than val.
应该叫做equal_or_upper_bound才对
lower bound难道不应该是 compare less than val嘛?
究竟为什么起了这么confusing的一个名字 | p***o 发帖数: 1252 | 2 std::lower_bound returns the lowest position to insert the element without
violating the ordering. std::upper_bound returns the highest position.
If elements with the same value are not presented, std::lower_bound and
std::upper_bound return the same position. Otherwise, lower_bound returns
the iterator to the first such element and upper_bound returns the iterator
after the last such element.
)
【在 g*c 的大作中提到】 : Returns an iterator pointing to the first element in the range [first,last) : which does not compare less than val. : 应该叫做equal_or_upper_bound才对 : lower bound难道不应该是 compare less than val嘛? : 究竟为什么起了这么confusing的一个名字
| g*c 发帖数: 4510 | 3 so good an explanation. thx
iterator
【在 p***o 的大作中提到】 : std::lower_bound returns the lowest position to insert the element without : violating the ordering. std::upper_bound returns the highest position. : If elements with the same value are not presented, std::lower_bound and : std::upper_bound return the same position. Otherwise, lower_bound returns : the iterator to the first such element and upper_bound returns the iterator : after the last such element. : : )
|
|