“cpp/thread/promise/uses allocator”的版本间的差异
来自cppreference.com
小 |
|||
第1行: | 第1行: | ||
{{cpp/title|uses_allocator{{small|<std::promise>}}}} | {{cpp/title|uses_allocator{{small|<std::promise>}}}} | ||
{{cpp/thread/promise/navbar}} | {{cpp/thread/promise/navbar}} | ||
− | {{ddcl | since=c++11 | | + | {{ddcl|since=c++11| |
template< class R, class Alloc > | template< class R, class Alloc > | ||
− | struct uses_allocator<std::promise<R>, Alloc> : std::true_type { }; | + | struct uses_allocator<std::promise<R>, Alloc> : std::true_type {}; |
}} | }} | ||
− | 为 {{lc|std::promise}} 提供 {{lc|std::uses_allocator}} 类型特 | + | 为 {{lc|std::promise}} 提供 {{lc|std::uses_allocator}} 类型特 的特化。 |
− | {{cpp/types/integral_constant/inherit2 |{{c|true}}|bool}} | + | {{cpp/types/integral_constant/inherit2|{{c|true}}|bool}} |
===参阅=== | ===参阅=== | ||
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc inc | cpp/memory/dsc uses allocator}} | + | {{dsc inc|cpp/memory/dsc uses allocator}} |
{{dsc end}} | {{dsc end}} | ||
{{langlinks|de|en|es|fr|it|ja|pt|ru}} | {{langlinks|de|en|es|fr|it|ja|pt|ru}} |
2024年3月13日 (三) 10:28的最后版本
template< class R, class Alloc > struct uses_allocator<std::promise<R>, Alloc> : std::true_type {}; |
(C++11 起) | |
为 std::promise 提供 std::uses_allocator 类型特征的特化。
目录 |
继承自 std::integral_constant
成员常量
value [静态] |
true (公开静态成员常量) |
成员函数
operator bool |
将对象转换到 bool,返回 value (公开成员函数) |
operator() (C++14) |
返回 value (公开成员函数) |
成员类型
类型 | 定义 |
value_type
|
bool |
type
|
std::integral_constant<bool, value> |
[编辑] 参阅
(C++11) |
检查指定的类型是否支持使用分配器的构造 (类模板) |