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.

另见