簡體   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