diff --git a/source/future.tex b/source/future.tex index 44b4b31aa1..561272faeb 100644 --- a/source/future.tex +++ b/source/future.tex @@ -1369,6 +1369,14 @@ namespace std { template struct is_pod; template inline constexpr bool is_pod_v = is_pod::value; + template // \seebelow + struct aligned_storage; + template // \seebelow + using @\libglobal{aligned_storage_t}@ = typename aligned_storage::type; + template + struct aligned_union; + template + using @\libglobal{aligned_union_t}@ = typename aligned_union::type; } \end{codeblock} @@ -1403,6 +1411,74 @@ \end{note} \end{itemdescr} +\indexlibraryglobal{aligned_storage}% +\begin{itemdecl} +template + struct aligned_storage; +\end{itemdecl} + +\begin{itemdescr} +\pnum +The value of \exposid{default-alignment} is the most +stringent alignment requirement for any object type whose size +is no greater than \tcode{Len}\iref{basic.types}. + +\pnum +\mandates +\tcode{Len} is not zero. +\tcode{Align} is equal to \tcode{alignof(T)} for some type \tcode{T} or +to \exposid{default-alignment}. + +\pnum +The member typedef \tcode{type} is a trivial standard-layout type +suitable for use as uninitialized storage for any object +whose size is at most \tcode{Len} and +whose alignment is a divisor of \tcode{Align}. + +\pnum +\begin{note} +Uses of \tcode{aligned_storage::type} can be replaced +by an array \tcode{std::byte[Len]} declared with \tcode{alignas(Align)}. +\end{note} + +\pnum +\begin{note} +A typical implementation would define \tcode{aligned_storage} as: +\begin{codeblock} +template +struct aligned_storage { + typedef struct { + alignas(Alignment) unsigned char __data[Len]; + } type; +}; +\end{codeblock} +\end{note} + +\end{itemdescr} + +\indexlibraryglobal{aligned_union}% +\begin{itemdecl} +template + struct aligned_union; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\mandates +At least one type is provided. +Each type in the template parameter pack \tcode{Types} +is a complete object type. + +\pnum +The member typedef \tcode{type} is a trivial standard-layout type +suitable for use as uninitialized storage for any object +whose type is listed in \tcode{Types}; +its size shall be at least \tcode{Len}. +The static member \tcode{alignment_value} +is an integral constant of type \tcode{size_t} +whose value is the strictest alignment of all types listed in \tcode{Types}. +\end{itemdescr} + \rSec1[depr.tuple]{Tuple} \pnum diff --git a/source/utilities.tex b/source/utilities.tex index 12451a592a..f14fea67fa 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -19635,9 +19635,6 @@ // \ref{meta.trans.other}, other transformations template struct type_identity; - template // see \ref{meta.trans.other} - struct aligned_storage; - template struct aligned_union; template struct remove_cvref; template struct decay; template struct enable_if; @@ -19653,10 +19650,6 @@ template using @\libglobal{type_identity_t}@ = typename type_identity::type; - template // see \ref{meta.trans.other} - using @\libglobal{aligned_storage_t}@ = typename aligned_storage::type; - template - using @\libglobal{aligned_union_t}@ = typename aligned_union::type; template using @\libglobal{remove_cvref_t}@ = typename remove_cvref::type; template @@ -21095,36 +21088,6 @@ & The member typedef \tcode{type} names the type \tcode{T}. \\ \rowsep -\indexlibraryglobal{aligned_storage}% -\tcode{template\br - struct aligned_storage;} - & - The value of \textit{default-alignment} shall be the most - stringent alignment requirement for any object type whose size - is no greater than \tcode{Len}\iref{basic.types}. - The member typedef \tcode{type} shall be a trivial standard-layout type - suitable for use as uninitialized storage for any object whose size - is at most \tcode{Len} and whose alignment is a divisor of \tcode{Align}.\br - \mandates \tcode{Len} is not zero. \tcode{Align} is equal to - \tcode{alignof(T)} for some type \tcode{T} or to \textit{default-alignment}.\\ \rowsep - -\indexlibraryglobal{aligned_union}% -\tcode{template\br - struct aligned_union;} - & - The member typedef \tcode{type} shall be a trivial standard-layout type suitable for use as - uninitialized storage for any object whose type is listed in \tcode{Types}; - its size shall be at least \tcode{Len}. The static member \tcode{alignment_value} - shall be an integral constant of type \tcode{size_t} whose value is the - strictest alignment of all types listed in \tcode{Types}.\br - \mandates At least one type is provided. - Each type in the template parameter pack \tcode{Types} - is a complete object type. - \\ \rowsep - \indexlibraryglobal{remove_cvref}% \tcode{template\br struct remove_cvref;} & @@ -21235,21 +21198,6 @@ denotes the type \tcode{unwrap_reference_t>}.\\ \end{libreqtab2a} -\indexlibraryglobal{aligned_storage}% -\pnum -\begin{note} -A typical implementation would define \tcode{aligned_storage} as: - -\begin{codeblock} -template -struct aligned_storage { - typedef struct { - alignas(Alignment) unsigned char __data[Len]; - } type; -}; -\end{codeblock} -\end{note} - \pnum In addition to being available via inclusion of the \tcode{} header, the templates