mirror of
https://github.com/boostorg/variant2.git
synced 2025-07-31 12:47:15 +02:00
Fix documentation of get_if
This commit is contained in:
@ -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
|
||||
|
||||
```
|
||||
|
Reference in New Issue
Block a user