return *new (buffer) T;
}
- /// Destroy the stored \a T.
- template <typename T>
- inline void
- destroy()
- {
- reinterpret_cast<T&>(buffer).~T();
- }
-
/// Accessor to a built \a T.
template <typename T>
inline T&
return reinterpret_cast<const T&>(buffer);
}
+ /// Destroy the stored \a T.
+ template <typename T>
+ inline void
+ destroy()
+ {
+ as<T>().~T();
+ }
+
/// A buffer large enough to store any of the semantic values.
char buffer[S];
};