且构网

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

find()还返回了C ++中映射的最后一个元素吗?

更新时间:2023-11-10 07:51:27

任何容器中的最后一个元素不同于容器 end 迭代器。 end 迭代器实际上是超出容器中最后一个元素的一步。

The last element in any container is not the same as the containers end iterator. The end iterator is actually one step beyond the last element in the container.

这意味着你可以轻松休息,并使用找到,不用担心。如果您寻找的元素是最后一个元素,您将获得您搜索的内容。

That means you can rest easily, and use find without worries. If the element you look for is the last element, you will get what you search for.