Namespaces
Variants
Views
Actions

std::aligned_union

From cppreference.com
< cpp‎ | types
Revision as of 15:04, 21 May 2013 by Dieram3 (Talk | contribs)

 
 
 
Type support
Basic types
Fundamental types
Fixed width integer types (C++11)
Numeric limits
C numeric limits interface
Runtime type information
Type traits
Primary type categories
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
Type properties
(C++11)
(C++11)
(C++11)
(C++14)
Supported operations
Relationships and property queries
(C++11)
(C++11)
(C++11)
(C++11)
Type modifications
(C++11)(C++11)(C++11)
Type transformations
aligned_union
(C++11)
(C++11)
(C++11)
(C++11)
Type trait constants
 

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <type_traits>
</td>

<td></td> <td></td> <tr class="t-dcl ">

<td >
template< std::size_t Len, class... Types >
struct aligned_union;
</td>

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> Template:ddcl list end

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.

Contents

Member types

Name Definition
type the POD type suitable for storage of any type from Types

Helper types

Template:ddcl list begin <tr class="t-dcl ">

<td >
template< std::size_t Len, class... Types >
using aligned_union_t = typename aligned_union<Len,Types...>::type;
</td>

<td class="t-dcl-nopad"> </td> <td > (since C++14) </td> </tr> Template:ddcl list end

Member constants

alignment_value
[static]
the strictest alignment requirement of all Types
(public static member constant)

Example

See also

obtains the type's alignment requirements
(class template) [edit]
defines the type suitable for use as uninitialized storage for types of given size
(class template) [edit]