且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

是否有 STL 算法来查找序列中值的最后一个实例?

更新时间:2023-02-26 17:03:24

但现在的问题是我不能使用头"和尾"范围begin() 和 end() 因为它们不是反向迭代器.

But the problem now is that I can't make "head" and "tail" ranges using begin() and end() because those aren't reverse iterators.

reverse_iterator::base() 是您正在寻找的 - SGI reverse_iterator 描述在 cppreference.com 上

reverse_iterator::base() is what you are looking for - section new members on SGIs reverse_iterator description or here on cppreference.com