Fix documentation of get_if

This commit is contained in:
Peter Dimov
2019-02-22 12:27:53 +02:00
parent d6d1cbd9fe
commit 2ea2ff915b

View File

@ -109,11 +109,12 @@ template<size_t I, class... T>
template<size_t I, class... T>
constexpr add_pointer_t<const variant_alternative_t<I, variant<T...>>>
get_if(const variant<T...>* v) noexcept;
template<class T, class... T>
constexpr add_pointer_t<T>
template<class U, class... T>
constexpr add_pointer_t<U>
get_if(variant<T...>* v) noexcept;
template<class T, class... T>
constexpr add_pointer_t<const T>
template<class U, class... T>
constexpr add_pointer_t<const U>
get_if(const variant<T...>* v) noexcept;
// relational operators
@ -745,16 +746,6 @@ template<size_t I, class... T>
constexpr add_pointer_t<const variant_alternative_t<I, variant<T...>>>
get_if(const variant<T...>* v) noexcept;
```
```
template<class T, class... T>
constexpr add_pointer_t<T>
get_if(variant<T...>* v) noexcept;
```
```
template<class T, class... T>
constexpr add_pointer_t<const T>
get_if(const variant<T...>* 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<class U, class... T>
constexpr add_pointer_t<U>
get_if(variant<T...>* v) noexcept;
```
```
template<class U, class... T>
constexpr add_pointer_t<const U>
get_if(const variant<T...>* 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<I>(v);` with `I` being
the zero-based index of `U` in `T...`.
### Relational Operators
```