Skip to content

Commit

Permalink
#796: union: add comment about Sizer union and Aligner
Browse files Browse the repository at this point in the history
  • Loading branch information
lifflander committed Jun 8, 2020
1 parent 4789e75 commit 3710bf0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/vt/utils/adt/union.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ namespace detail {

///////////////////////////////////////////////////////////////////////////////

/**
* \internal \struct Sizer
*
* \brief Union of char[sizeof(U)] all types (T, Ts...) which is never
* constructed but used to calculate the appropriate size of the
* \c AlignedCharUnion to hold any of these types.
*/
template <typename T, typename... Ts>
union Sizer {
char _cur[sizeof(T)];
Expand All @@ -65,6 +72,12 @@ union Sizer<T> {

///////////////////////////////////////////////////////////////////////////////

/**
* \internal \struct Aligner
*
* \brief Contains all the types (T, Ts...) to determine the max alignment
* required for them for the alignas in the \c AlignedCharUnion
*/
template <typename T, typename... Ts>
struct Aligner {
Aligner() = delete;
Expand Down

0 comments on commit 3710bf0

Please sign in to comment.