繁体   English   中英

有没有办法让一对在排序数组中同时具有lower_bound和upper_bound?

[英]Is there a way to get a pair having both the lower_bound and upper_bound in a sorted array?

如果我有一个包含元素{1,1,1,2,2,2,3,3,3}std::vector

有没有办法让一对包含 value = 2 的lower_boundupper_bound

而不是我分别调用std::lower_boundstd::upper_bound

简单地说,字面意思是: std::equal_range

您可以使用std::equal_range

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM