|
19635 | 19635 |
|
19636 | 19636 | // \ref{meta.trans.other}, other transformations
|
19637 | 19637 | template<class T> struct type_identity;
|
19638 |
| - template<size_t Len, size_t Align = @\textit{default-alignment}@> // see \ref{meta.trans.other} |
19639 |
| - struct aligned_storage; |
19640 |
| - template<size_t Len, class... Types> struct aligned_union; |
19641 | 19638 | template<class T> struct remove_cvref;
|
19642 | 19639 | template<class T> struct decay;
|
19643 | 19640 | template<bool, class T = void> struct enable_if;
|
|
19653 | 19650 |
|
19654 | 19651 | template<class T>
|
19655 | 19652 | using @\libglobal{type_identity_t}@ = typename type_identity<T>::type;
|
19656 |
| - template<size_t Len, size_t Align = @\textit{default-alignment}@> // see \ref{meta.trans.other} |
19657 |
| - using @\libglobal{aligned_storage_t}@ = typename aligned_storage<Len, Align>::type; |
19658 |
| - template<size_t Len, class... Types> |
19659 |
| - using @\libglobal{aligned_union_t}@ = typename aligned_union<Len, Types...>::type; |
19660 | 19653 | template<class T>
|
19661 | 19654 | using @\libglobal{remove_cvref_t}@ = typename remove_cvref<T>::type;
|
19662 | 19655 | template<class T>
|
|
21095 | 21088 | &
|
21096 | 21089 | The member typedef \tcode{type} names the type \tcode{T}. \\ \rowsep
|
21097 | 21090 |
|
21098 |
| -\indexlibraryglobal{aligned_storage}% |
21099 |
| -\tcode{template<size_t Len,\br |
21100 |
| - size_t Align\br |
21101 |
| - = \textit{default-alignment}>\br |
21102 |
| - struct aligned_storage;} |
21103 |
| - & |
21104 |
| - The value of \textit{default-alignment} shall be the most |
21105 |
| - stringent alignment requirement for any object type whose size |
21106 |
| - is no greater than \tcode{Len}\iref{basic.types}. |
21107 |
| - The member typedef \tcode{type} shall be a trivial standard-layout type |
21108 |
| - suitable for use as uninitialized storage for any object whose size |
21109 |
| - is at most \tcode{Len} and whose alignment is a divisor of \tcode{Align}.\br |
21110 |
| - \mandates \tcode{Len} is not zero. \tcode{Align} is equal to |
21111 |
| - \tcode{alignof(T)} for some type \tcode{T} or to \textit{default-alignment}.\\ \rowsep |
21112 |
| - |
21113 |
| -\indexlibraryglobal{aligned_union}% |
21114 |
| -\tcode{template<size_t Len,\br |
21115 |
| - class... Types>\br |
21116 |
| - struct aligned_union;} |
21117 |
| - & |
21118 |
| - The member typedef \tcode{type} shall be a trivial standard-layout type suitable for use as |
21119 |
| - uninitialized storage for any object whose type is listed in \tcode{Types}; |
21120 |
| - its size shall be at least \tcode{Len}. The static member \tcode{alignment_value} |
21121 |
| - shall be an integral constant of type \tcode{size_t} whose value is the |
21122 |
| - strictest alignment of all types listed in \tcode{Types}.\br |
21123 |
| - \mandates At least one type is provided. |
21124 |
| - Each type in the template parameter pack \tcode{Types} |
21125 |
| - is a complete object type. |
21126 |
| - \\ \rowsep |
21127 |
| - |
21128 | 21091 | \indexlibraryglobal{remove_cvref}%
|
21129 | 21092 | \tcode{template<class T>\br struct remove_cvref;}
|
21130 | 21093 | &
|
|
21235 | 21198 | denotes the type \tcode{unwrap_reference_t<decay_t<T>>}.\\
|
21236 | 21199 | \end{libreqtab2a}
|
21237 | 21200 |
|
21238 |
| -\indexlibraryglobal{aligned_storage}% |
21239 |
| -\pnum |
21240 |
| -\begin{note} |
21241 |
| -A typical implementation would define \tcode{aligned_storage} as: |
21242 |
| - |
21243 |
| -\begin{codeblock} |
21244 |
| -template<size_t Len, size_t Alignment> |
21245 |
| -struct aligned_storage { |
21246 |
| - typedef struct { |
21247 |
| - alignas(Alignment) unsigned char __data[Len]; |
21248 |
| - } type; |
21249 |
| -}; |
21250 |
| -\end{codeblock} |
21251 |
| -\end{note} |
21252 |
| - |
21253 | 21201 | \pnum
|
21254 | 21202 | In addition to being available via inclusion
|
21255 | 21203 | of the \tcode{<type_traits>} header, the templates
|
|
0 commit comments