Bjorn Reese wrote:
The overview states that "variant
is not trivial when all contained types are trivial". Why not? Is this an advantage somehow or an unfortunate limitation?
It is a limitation. I want to get everything correct first, before introducing additional complexity into the implementation. (And as Andrzej demonstrated, there's still work to do there.)
Change "variant_npos = -1" into "variant_npos = unspecified"
variant_npos is provided for compatibility with std::variant, and it's defined as -1 in the standard.
Add a comment about the purpose of valuesless_by_exception(). Without such a comment, the function seems very odd on a "never valueless variant type."
Yes, agreed, I should note that it's provided for compatibility, same as _npos.
The destructor should be marked as noexcept.
Destructors are noexcept by default.