跳到主要内容

std::string get_allocator() 方法

// Const version only
constexpr allocator_type get_allocator() const noexcept;

返回与字符串关联的分配器。

注意

allocator_typestd::string 类参考中解释。

参数

(无)

返回值

关联的分配器。

复杂度

常数 - O(1)

示例

重要

本节需要改进。您可以通过编辑此文档页面来帮助我们。

另请参阅

pub分配器

默认分配器。

puballocator_traits

提供有关分配器类型的信息。

pubuses_allocator

检查指定类型是否支持使用分配器构造。

本文档源自此 CppReference 页面。它可能为了改进或编辑偏好而被修改。点击“编辑此页面”查看本文档的所有更改。
悬停查看原始许可证。

std::string get_allocator() 方法

// Const version only
constexpr allocator_type get_allocator() const noexcept;

返回与字符串关联的分配器。

注意

allocator_typestd::string 类参考中解释。

参数

(无)

返回值

关联的分配器。

复杂度

常数 - O(1)

示例

重要

本节需要改进。您可以通过编辑此文档页面来帮助我们。

另请参阅

pub分配器

默认分配器。

puballocator_traits

提供有关分配器类型的信息。

pubuses_allocator

检查指定类型是否支持使用分配器构造。

本文档源自此 CppReference 页面。它可能为了改进或编辑偏好而被修改。点击“编辑此页面”查看本文档的所有更改。
悬停查看原始许可证。