名稱空間
變體
操作

std::forward_list<T,Allocator>::before_begin, cbefore_begin

來自 cppreference.com
< cpp‎ | 容器‎ | forward_list
 
 
 
 
iterator before_begin() noexcept;
(C++11 起)
const_iterator before_begin() const noexcept;
(C++11 起)
const_iterator cbefore_begin() const noexcept;
(C++11 起)

返回指向容器第一個元素之前元素的迭代器。此元素充當佔位符,嘗試訪問它會導致未定義行為。唯一的使用場景是函式 insert_after(), emplace_after(), erase_after(), splice_after() 和增量運算子:遞增 before-begin 迭代器會得到與從 begin()/cbegin() 獲得的迭代器完全相同的迭代器。

目錄

[編輯] 引數

(無)

[編輯] 返回值

指向第一個元素之前元素的迭代器。

[編輯] 複雜度

常數時間。

[編輯] 示例

[編輯] 參閱

返回指向起始的迭代器
(公共成員函式) [編輯]
返回指向末尾的迭代器
(公共成員函式) [編輯]