LLVM 20.0.0git
Public Types | Public Attributes | List of all members
llvm::AlignedCharArrayUnion< T, Ts > Struct Template Reference

A suitably aligned and sized character array member which can hold elements of any type. More...

#include "llvm/Support/AlignOf.h"

Public Types

using AlignedUnion = std::aligned_union_t< 1, T, Ts... >
 

Public Attributes

char buffer [sizeof(AlignedUnion)]
 

Detailed Description

template<typename T, typename... Ts>
struct llvm::AlignedCharArrayUnion< T, Ts >

A suitably aligned and sized character array member which can hold elements of any type.

This template is equivalent to std::aligned_union_t<1, ...>, but we cannot use it due to a bug in the MSVC x86 compiler: https://github.com/microsoft/STL/issues/1533 Using alignas here works around the bug.

Definition at line 27 of file AlignOf.h.

Member Typedef Documentation

◆ AlignedUnion

template<typename T , typename... Ts>
using llvm::AlignedCharArrayUnion< T, Ts >::AlignedUnion = std::aligned_union_t<1, T, Ts...>

Definition at line 28 of file AlignOf.h.

Member Data Documentation

◆ buffer

template<typename T , typename... Ts>
char llvm::AlignedCharArrayUnion< T, Ts >::buffer[sizeof(AlignedUnion)]

Definition at line 29 of file AlignOf.h.


The documentation for this struct was generated from the following file: