std::aligned_union
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
| 在头文件 <type_traits> 中定义
|
||
| template< std::size_t Len, class... Types > struct aligned_union; |
(C++11 起) | |
提供的的成员typedef
type,这是一个POD类型适合用作未初始化的存储,一个目的的任何类型中列出Types正确对齐。所述存储的大小是至少Len。 std::aligned_union也决定了严格的(最大)之间的对齐要求所有Types,使得它可以作为不断alignment_value.原文:
Provides the member typedef
type, which is a POD type suitable for use as uninitialized storage, correctly aligned for an object of any of the types listed in Types. The size of the storage is at least Len. std::aligned_union also determines the strictest (largest) alignment requirement among all Types and makes it available as the constant alignment_value.目录 |
[编辑] 会员类型
| 姓名
|
Definition |
type
|
的POD类型适用于存储的任何种类的
Types 原文: the POD type suitable for storage of any type from Types |
[编辑] 会员常数
| alignment_value [静态的]</div></div>
|
最严格的对齐要求所有 Types 原文: the strictest alignment requirement of all Types (公共静态成员常量) |
[编辑] 示例
| 本章尚未完成 原因:暂无示例 |
[编辑] 另请参阅
| (C++11) |
获取类型的最小对齐字节数 (类模板) |
| (C++11) |
定义类型在未初始化时需要的内存空间大小 (类模板) |