Skip to content

Commit

Permalink
Merge 2018-11 LWG Motion 8
Browse files Browse the repository at this point in the history
P0655R1 visit<R>: Explicit Return Type for visit

Fixes #2414
  • Loading branch information
zygoloid committed Nov 26, 2018
2 parents 69e8a2f + 7cfa8ff commit 1b4266f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions source/utilities.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3775,6 +3775,8 @@
// \ref{variant.visit}, visitation
template<class Visitor, class... Variants>
constexpr @\seebelow@ visit(Visitor&&, Variants&&...);
template <class R, class Visitor, class... Variants>
constexpr R visit(Visitor&&, Variants&&...);

// \ref{variant.monostate}, class \tcode{monostate}
struct monostate;
Expand Down Expand Up @@ -4862,6 +4864,8 @@
\begin{itemdecl}
template<class Visitor, class... Variants>
constexpr @\seebelow@ visit(Visitor&& vis, Variants&&... vars);
template <class R, class Visitor, class... Variants>
constexpr R visit(Visitor&& vis, Variants&&... vars);
\end{itemdecl}

\begin{itemdescr}
Expand All @@ -4874,6 +4878,11 @@
\begin{codeblock}
@\placeholder{INVOKE}@(std::forward<Visitor>(vis), get<m>(std::forward<Variants>(vars))...) // see \ref{func.require}
\end{codeblock}
for the first form and
\begin{codeblock}
@\placeholder{INVOKE}@<R>(std::forward<Visitor>(vis), get<m>(std::forward<Variants>(vars))...) // see \ref{func.require}
\end{codeblock}
for the second form.

\pnum
\requires
Expand All @@ -4883,8 +4892,9 @@

\pnum
\returns $e(\tcode{m})$, where \tcode{m} is the pack for which
$\tcode{m}_i$ is \tcode{vars$_i$.index()} for
all $0 \leq i < n$. The return type is $\tcode{decltype(}e(\tcode{m})\tcode{)}$.
$\tcode{m}_i$ is \tcode{vars$_i$.index()} for all $0 \leq i < n$.
The return type is $\tcode{decltype(}e(\tcode{m})\tcode{)}$
for the first form.

\pnum
\throws
Expand Down

0 comments on commit 1b4266f

Please sign in to comment.