Skip to content

Commit 1b4266f

Browse files
authored
Merge 2018-11 LWG Motion 8
P0655R1 visit<R>: Explicit Return Type for visit Fixes #2414
2 parents 69e8a2f + 7cfa8ff commit 1b4266f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

source/utilities.tex

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3775,6 +3775,8 @@
37753775
// \ref{variant.visit}, visitation
37763776
template<class Visitor, class... Variants>
37773777
constexpr @\seebelow@ visit(Visitor&&, Variants&&...);
3778+
template <class R, class Visitor, class... Variants>
3779+
constexpr R visit(Visitor&&, Variants&&...);
37783780

37793781
// \ref{variant.monostate}, class \tcode{monostate}
37803782
struct monostate;
@@ -4862,6 +4864,8 @@
48624864
\begin{itemdecl}
48634865
template<class Visitor, class... Variants>
48644866
constexpr @\seebelow@ visit(Visitor&& vis, Variants&&... vars);
4867+
template <class R, class Visitor, class... Variants>
4868+
constexpr R visit(Visitor&& vis, Variants&&... vars);
48654869
\end{itemdecl}
48664870

48674871
\begin{itemdescr}
@@ -4874,6 +4878,11 @@
48744878
\begin{codeblock}
48754879
@\placeholder{INVOKE}@(std::forward<Visitor>(vis), get<m>(std::forward<Variants>(vars))...) // see \ref{func.require}
48764880
\end{codeblock}
4881+
for the first form and
4882+
\begin{codeblock}
4883+
@\placeholder{INVOKE}@<R>(std::forward<Visitor>(vis), get<m>(std::forward<Variants>(vars))...) // see \ref{func.require}
4884+
\end{codeblock}
4885+
for the second form.
48774886

48784887
\pnum
48794888
\requires
@@ -4883,8 +4892,9 @@
48834892

48844893
\pnum
48854894
\returns $e(\tcode{m})$, where \tcode{m} is the pack for which
4886-
$\tcode{m}_i$ is \tcode{vars$_i$.index()} for
4887-
all $0 \leq i < n$. The return type is $\tcode{decltype(}e(\tcode{m})\tcode{)}$.
4895+
$\tcode{m}_i$ is \tcode{vars$_i$.index()} for all $0 \leq i < n$.
4896+
The return type is $\tcode{decltype(}e(\tcode{m})\tcode{)}$
4897+
for the first form.
48884898

48894899
\pnum
48904900
\throws

0 commit comments

Comments
 (0)