std::vector<T,Allocator>::end, std::vector<T,Allocator>::cend_C++中文网

位置:首页 > C++ 参考手册 >容器库 >std::vector > std::vector<T,Allocator>::end, std::vector<T,Allocator>::cend

iterator end();

(C++11 前)

iterator end() noexcept;

(C++11 起)

const_iterator end() const;

(C++11 前)

const_iterator end() const noexcept;

(C++11 起)

const_iterator cend() const noexcept;

(C++11 起)

返回指向 vector 末元素后一元素的迭代器。

此元素表现为占位符;试图访问它导致未定义行为。

range-begin-end.svg

参数

(无)

返回值

指向后随最后元素的迭代器。

复杂度

常数。

参阅

返回指向容器第一个元素的迭代器
(公开成员函数)