mirror of
https://github.com/boostorg/variant2.git
synced 2025-08-01 13:14:27 +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>
|
template<size_t I, class... T>
|
||||||
constexpr add_pointer_t<const variant_alternative_t<I, variant<T...>>>
|
constexpr add_pointer_t<const variant_alternative_t<I, variant<T...>>>
|
||||||
get_if(const variant<T...>* v) noexcept;
|
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;
|
get_if(variant<T...>* v) noexcept;
|
||||||
template<class T, class... T>
|
template<class U, class... T>
|
||||||
constexpr add_pointer_t<const T>
|
constexpr add_pointer_t<const U>
|
||||||
get_if(const variant<T...>* v) noexcept;
|
get_if(const variant<T...>* v) noexcept;
|
||||||
|
|
||||||
// relational operators
|
// relational operators
|
||||||
@@ -745,16 +746,6 @@ template<size_t I, class... T>
|
|||||||
constexpr add_pointer_t<const variant_alternative_t<I, variant<T...>>>
|
constexpr add_pointer_t<const variant_alternative_t<I, variant<T...>>>
|
||||||
get_if(const variant<T...>* v) noexcept;
|
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]
|
[none]
|
||||||
* {blank}
|
* {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
|
Effects: :: A pointer to the value stored in the variant, if
|
||||||
`v != nullptr && v\->index() == I`. Otherwise, `nullptr`.
|
`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
|
### Relational Operators
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user