{]b4_assert_if([
assert(!built);
built = true;])[
- return *new (buffer) T;
+ return *new (buffer.raw) T;
}
/// Instantiate a \a T in here from \a t.
{]b4_assert_if([
assert(!built);
built = true;])[
- return *new (buffer) T(t);
+ return *new (buffer.raw) T(t);
}
/// Construct and fill.
variant (const T& t)]b4_assert_if([
: built(true)])[
{
- new (buffer) T(t);
+ new (buffer.raw) T(t);
}
/// Accessor to a built \a T.
as()
{]b4_assert_if([
assert(built);])[
- return reinterpret_cast<T&>(buffer);
+ return reinterpret_cast<T&>(buffer.raw);
}
/// Const accessor to a built \a T (for %printer).
as() const
{]b4_assert_if([
assert(built);])[
- return reinterpret_cast<const T&>(buffer);
+ return reinterpret_cast<const T&>(buffer.raw);
}
/// Swap the content with \a other.
}
/// A buffer large enough to store any of the semantic values.
- char buffer[S];
+ /// Long double is chosen as it has the strongest alignment
+ /// constraints.
+ union {
+ long double align_me;
+ char raw[S];
+ } buffer;
};
]])[
]b4_namespace_close[