---
name: "std::aligned_union"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::aligned_union/3cxx"
---

# std::aligned\_union(3cxx)

Provide aligned storage for types.

## NAME

std::aligned\_union\< \_Len, \_Types \> - Provide aligned storage for types.

## SYNOPSIS

`#include <type_traits>`

### Public Types

**typedef** **aligned\_storage**\< \_S\_len, **alignment\_value** \>::type **type**\
 The storage.

### Static Public Attributes

**static** const size\_t **alignment\_value**\
 The value of the strictest alignment of \_Types.

## Detailed Description

### template\<size\_t \_Len, typename... \_Types\>

struct std::aligned\_union\< \_Len, \_Types \>"Provide aligned storage for types.

\[meta.trans.other\]

Provides aligned storage for any of the provided types of at least size \_Len.

**See also**

aligned\_storage

## Member Typedef Documentation

### template\<size\_t \_Len, typename... \_Types\> typedef aligned\_storage\<\_S\_len,alignment\_value\>::type std::aligned\_union\< \_Len, \_Types \>::type

The storage.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
