diff --git a/doc/variant2/changelog.adoc b/doc/variant2/changelog.adoc index dd903ee..fc14105 100644 --- a/doc/variant2/changelog.adoc +++ b/doc/variant2/changelog.adoc @@ -8,6 +8,10 @@ https://www.boost.org/LICENSE_1_0.txt # Revision History :idprefix: changelog_ +## Changes in 1.83.0 + +* Added `uses_double_storage()`. + ## Changes in 1.81.0 * Added support for `boost::json::value_from` and `boost::json::value_to`. diff --git a/doc/variant2/reference.adoc b/doc/variant2/reference.adoc index beede7b..04bd748 100644 --- a/doc/variant2/reference.adoc +++ b/doc/variant2/reference.adoc @@ -250,6 +250,8 @@ public: constexpr bool valueless_by_exception() const noexcept; constexpr size_t index() const noexcept; + static constexpr bool uses_double_storage() noexcept; + // swap void swap( variant& r ) noexcept( /*see below*/ ); @@ -570,6 +572,18 @@ constexpr size_t index() const noexcept; Returns: :: The zero-based index of the active alternative. +``` +static constexpr bool uses_double_storage() noexcept; +``` +[none] +* {blank} ++ +Returns: :: + `true` if the variant uses double storage to meet the never valueless + guarantee because one of the alternatives is not nothrow move constructible, + and `false` otherwise. + + #### Swap ```