From e2546b70ca04d4263f7a5917815506e488b6920f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 29 Jun 2023 18:32:58 +0300 Subject: [PATCH] Document uses_double_storage(). Refs #37. --- doc/variant2/changelog.adoc | 4 ++++ doc/variant2/reference.adoc | 14 ++++++++++++++ 2 files changed, 18 insertions(+) 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 ```