diff --git a/doc/variant/reference.adoc b/doc/variant/reference.adoc index 3f6a98f..955d486 100644 --- a/doc/variant/reference.adoc +++ b/doc/variant/reference.adoc @@ -109,11 +109,12 @@ template template constexpr add_pointer_t>> get_if(const variant* v) noexcept; -template - constexpr add_pointer_t + +template + constexpr add_pointer_t get_if(variant* v) noexcept; -template - constexpr add_pointer_t +template + constexpr add_pointer_t get_if(const variant* v) noexcept; // relational operators @@ -745,16 +746,6 @@ template constexpr add_pointer_t>> get_if(const variant* v) noexcept; ``` -``` -template - constexpr add_pointer_t - get_if(variant* v) noexcept; -``` -``` -template - constexpr add_pointer_t - get_if(const variant* v) noexcept; -``` [none] * {blank} + @@ -762,6 +753,24 @@ Requires: :: `I < sizeof...(U)`. Otherwise, the program is ill-formed. Effects: :: A pointer to the value stored in the variant, if `v != nullptr && v\->index() == I`. Otherwise, `nullptr`. +``` +template + constexpr add_pointer_t + get_if(variant* v) noexcept; +``` +``` +template + constexpr add_pointer_t + get_if(const variant* v) noexcept; +``` +[none] +* {blank} ++ +Requires: :: The type `U` occurs exactly once in `T...`. Otherwise, the + program is ill-formed. +Effects: :: Equivalent to: `return get_if(v);` with `I` being + the zero-based index of `U` in `T...`. + ### Relational Operators ```