Document visit<R>

This commit is contained in:
Peter Dimov
2020-06-03 18:01:57 +03:00
parent 5586ebaa64
commit d3db874762
2 changed files with 7 additions and 2 deletions

View File

@ -15,6 +15,7 @@ http://www.boost.org/LICENSE_1_0.txt
* Added support for derived types in `visit`
* Improved compilation performance for many (hundreds of) alternatives.
* Added support for `visit<R>`
## Changes in 1.73.0

View File

@ -134,7 +134,7 @@ template<class... T>
// visit
template<class F, class... V>
template<class R = /*unspecified*/, class F, class... V>
constexpr /*see below*/ visit(F&& f, V&&... v);
// monostate
@ -838,7 +838,7 @@ Returns: ::
### visit
```
template<class F, class... V>
template<class R = /*unspecified*/, class F, class... V>
constexpr /*see below*/ visit(F&& f, V&&... v);
```
[none]
@ -846,6 +846,10 @@ template<class F, class... V>
+
Returns: :: `std::forward<F>(f)(get<I>(std::forward<V>(v))...)`, where
`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