public member function
<forward_list>

std::forward_list::get_allocator

allocator_type get_allocator() const noexcept;
獲取分配器
返回與容器關聯的分配器物件的副本。

引數



返回值

分配器。

成員型別allocator_type是容器使用的分配器的型別,在 forward_list 中定義為其第二個模板引數 (Alloc).

複雜度

常量。

迭代器有效性

沒有變化。

資料競爭

訪問容器。
不訪問任何包含的元素:併發訪問或修改它們是安全的。

異常安全

無異常保證:此成員函式從不丟擲異常。
預設分配器

另見