首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::set::lower_bound

iterator lower_bound( const Key& key );

(1)

const_iterator lower_bound( const Key& key ) const;

(1)

template< class K > iterator lower_bound(const K& x);

(2)

(since C++14)

template< class K > const_iterator lower_bound(const K& x) const;

(2)

(since C++14)

1%29返回指向第一个元素的迭代器,即不折不扣key...

2%29返回一个迭代器,指向比较不折不扣价值x。此重载仅在下列情况下才参与重载解析:Compare::is_transparent是有效的,并表示类型。它们允许调用此函数,而无需构造Key...

参数

key

-

key value to compare the elements to

x

-

alternative value that can be compared to Key

返回值

指向第一个元素的Iterator再少点key如果没有找到这样的元素,则使用一个过去的迭代器%28(见end()%29被返回。

复杂性

容器大小的对数。

另见

equal_range

returns range of elements matching a specific key (public member function)

upper_bound

returns an iterator to the first element greater than the given key (public member function)

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券