public member function
<string>

std::basic_string::get_allocator

allocator_type get_allocator() const;
allocator_type get_allocator() const noexcept;
Get allocator
Returns a copy of the allocator object associated with the basic_string.

引數



返回值

The allocator.

成員型別allocator_typeis the type of the allocator used by the container, defined in basic_string as an alias of its third template parameter (Alloc).

複雜度

未指定,但通常是恆定的。

迭代器有效性

沒有變化。

資料競爭

該物件被訪問。

異常安全

無異常保證:此成員函式從不丟擲異常。
Copying any instantiation of the default allocator is also guaranteed to never throw.

另見