std::string get_allocator() 方法
- 自 C++20 起
- 直到 C++20
// Const version only
constexpr allocator_type get_allocator() const noexcept;
// Const version only
allocator_type get_allocator() const;
返回与字符串关联的分配器。
注意
allocator_type
在std::string 类参考中解释。
参数
(无)
返回值
关联的分配器。
复杂度
常数 - O(1)。
示例
重要
本节需要改进。您可以通过编辑此文档页面来帮助我们。
另请参阅
pub | 分配器 | 默认分配器。 |
pub | allocator_traits | 提供有关分配器类型的信息。 |
pub | uses_allocator | 检查指定类型是否支持使用分配器构造。 |