mirror of
https://github.com/boostorg/variant2.git
synced 2025-07-30 04:07:16 +02:00
Document visit<R>
This commit is contained in:
@ -15,6 +15,7 @@ http://www.boost.org/LICENSE_1_0.txt
|
|||||||
|
|
||||||
* Added support for derived types in `visit`
|
* Added support for derived types in `visit`
|
||||||
* Improved compilation performance for many (hundreds of) alternatives.
|
* Improved compilation performance for many (hundreds of) alternatives.
|
||||||
|
* Added support for `visit<R>`
|
||||||
|
|
||||||
## Changes in 1.73.0
|
## Changes in 1.73.0
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ template<class... T>
|
|||||||
|
|
||||||
// visit
|
// visit
|
||||||
|
|
||||||
template<class F, class... V>
|
template<class R = /*unspecified*/, class F, class... V>
|
||||||
constexpr /*see below*/ visit(F&& f, V&&... v);
|
constexpr /*see below*/ visit(F&& f, V&&... v);
|
||||||
|
|
||||||
// monostate
|
// monostate
|
||||||
@ -838,7 +838,7 @@ Returns: ::
|
|||||||
### visit
|
### visit
|
||||||
|
|
||||||
```
|
```
|
||||||
template<class F, class... V>
|
template<class R = /*unspecified*/, class F, class... V>
|
||||||
constexpr /*see below*/ visit(F&& f, V&&... v);
|
constexpr /*see below*/ visit(F&& f, V&&... v);
|
||||||
```
|
```
|
||||||
[none]
|
[none]
|
||||||
@ -846,6 +846,10 @@ template<class F, class... V>
|
|||||||
+
|
+
|
||||||
Returns: :: `std::forward<F>(f)(get<I>(std::forward<V>(v))...)`, where
|
Returns: :: `std::forward<F>(f)(get<I>(std::forward<V>(v))...)`, where
|
||||||
`I...` is `v.index()...`.
|
`I...` is `v.index()...`.
|
||||||
|
Remarks: :: If `R` is given explicitly, as in `visit<int>`, the return
|
||||||
|
type is `R`. Otherwise, it's deduced from `F`. All possible applications
|
||||||
|
of `F` to the variant alternatives must have the same return type for
|
||||||
|
this deduction to succeed.
|
||||||
|
|
||||||
### swap
|
### swap
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user