Skip to content

P0655R1 visit<R>: Explicit Return Type for visit #2457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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