问题标签 [iterator-range]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
6 回答
1973 浏览

c++ - 如何使用标准库迭代相等的值?

假设我有一个向量:

该向量已排序,因此相等的元素彼此相邻。

获取表示具有相等元素的范围的所有迭代器对的最佳方法是什么(使用标准库)?

我想知道如何在上面的代码中获取be

因此,例如,如果v包含这些数字:

然后我想拥有be指向循环中的元素:

有没有用标准库解决这个问题的优雅方法?