WPILibC++ 2024.3.2
wpi::AlignedCharArrayUnion< T, Ts > Struct Template Reference

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

#include </home/runner/work/allwpilib/allwpilib/wpiutil/src/main/native/thirdparty/llvm/include/wpi/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 wpi::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.

Member Typedef Documentation

◆ AlignedUnion

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

Member Data Documentation

◆ buffer

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

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