由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - std::lower_bound 名不副实啊
相关主题
scala大牛幫看看這個map是為什麽?不太明白c++ iterator 弱问
stl的一个问题c++ template question:
about loop-invariant optimization请问Linux底下有没有最简易的show 2D x-y curve的工具
有没有大牛说说C里边for循环的坏处用那个design pattern好?
一个C++的概念问题关于inserter
intel icc hash_map 求救!binary_search只要求forward_iterator?
STL感觉实在太变态了deque的pointer和reference是怎么回事?
[菜鸟问题]类模板问题a question about std::stack
相关话题的讨论汇总
话题: bound话题: std话题: lower话题: returns话题: iterator
进入Programming版参与讨论
1 (共1页)
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.
:
: )

1 (共1页)
进入Programming版参与讨论
相关主题
a question about std::stack一个C++的概念问题
呼唤大侠们,我实在不能实现C++泛型的精神。intel icc hash_map 求救!
stl 的 member type 看起来挺头大的STL感觉实在太变态了
how to write a function take iterators as parameters?[菜鸟问题]类模板问题
scala大牛幫看看這個map是為什麽?不太明白c++ iterator 弱问
stl的一个问题c++ template question:
about loop-invariant optimization请问Linux底下有没有最简易的show 2D x-y curve的工具
有没有大牛说说C里边for循环的坏处用那个design pattern好?
相关话题的讨论汇总
话题: bound话题: std话题: lower话题: returns话题: iterator