Boost logo

Boost :

Subject: Re: [boost] [variant2] Comments on documentation
From: Peter Dimov (pdimov_at_[hidden])
Date: 2019-04-07 11:57:42

Bjorn Reese wrote:
> The overview states that "variant<T...> 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

> The destructor should be marked as noexcept.

Destructors are noexcept by default.

Boost list run by bdawes at, gregod at, cpdaniel at, john at