From 4c8b0d2dee50a237761adf34ab19c406f6e4a84a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 22 Feb 2019 02:07:47 +0200 Subject: [PATCH] Document reference specializations of variant_size, variant_alternative --- doc/variant/reference.adoc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/variant/reference.adoc b/doc/variant/reference.adoc index eed8867..3f6a98f 100644 --- a/doc/variant/reference.adoc +++ b/doc/variant/reference.adoc @@ -41,6 +41,9 @@ template struct variant_size: variant_size {}; template struct variant_size: variant_size {}; template struct variant_size: variant_size {}; +template struct variant_size: variant_size {}; // extension +template struct variant_size: variant_size {}; // extension + template inline constexpr size_t variant_size_v = variant_size::value; @@ -56,6 +59,9 @@ template struct variant_alternative; template struct variant_alternative; template struct variant_alternative; +template struct variant_alternative; // extension +template struct variant_alternative; // extension + template using variant_alternative_t = typename variant_alternative::type; @@ -630,6 +636,12 @@ template struct variant_alternative; ``` template struct variant_alternative; ``` +``` +template struct variant_alternative; // extension +``` +``` +template struct variant_alternative; // extension +``` [none] * {blank} + @@ -639,8 +651,10 @@ If `typename variant_alternative::type` exists and is `U`, * `variant_alternative::type` is `U const`; * `variant_alternative::type` is `U volatile`; * `variant_alternative::type` is `U const volatile`. +* `variant_alternative::type` is `U&`. +* `variant_alternative::type` is `U&&`. -Otherwise, the three structs have no `type` member. +Otherwise, these structs have no member `type`. -- ``` @@ -651,7 +665,7 @@ template * {blank} + When `I < sizeof...(T)`, the nested type `type` is an alias for the `I`-th -(zero-based) type in `T...`. Otherwise, there is no `type` member. +(zero-based) type in `T...`. Otherwise, there is no member `type`. ### holds_alternative