Skip to content

P3433R1 Allocator Support for Operation States #8002

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
35 changes: 33 additions & 2 deletions source/exec.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@
\begin{codeblock}
[]<class Sndr, class Rcvr>(Sndr&& sndr, Rcvr& rcvr) noexcept -> decltype(auto) {
auto& [_, data, ...child] = sndr;
return std::forward_like<Sndr>(data);
return @\exposid{allocator-aware-forward}@(std::forward_like<Sndr>(data), rcvr);
}
\end{codeblock}

Expand Down Expand Up @@ -1916,6 +1916,36 @@
\end{itemize}
\end{itemdescr}

\begin{itemdecl}
template<class T, class Context>
decltype(auto) @\exposid{allocator-aware-forward}@(T&& obj, Context&& context); // \expos
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent by two

\end{itemdecl}

\begin{itemdescr}
\pnum
\exposid{allocator-aware-forward} is an exposition-only function used to
either create a new object of type \tcode{T} from \tcode{obj}
or forward \tcode{obj} depending on whether an allocator is available.
If the environment associated with context provides an allocator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"context" should be code font:

Suggested change
If the environment associated with context provides an allocator
If the environment associated with \tcode{context} provides an allocator

(i.e., the expression \tcode{get_allocator(get_env(context))} is valid,
let \exposid{alloc} be the result of this expression
and \tcode{P} be \tcode{remove_cvref_t<T>}.

\pnum
\returns
\begin{itemize}
\item
If \exposid{alloc} is not defined, returns \tcode{std::forward<T>(obj)},
\item
otherwise if \tcode{P} is a specialization of \exposid{product-type},
returns an object of type \tcode{P} whose elements are initialized using
\tcode{make_obj_using_allocator<decltype(e)> (std::forward_like<T>(e), \exposid{alloc})}
where \tcode{e} is the corresponding element of \tcode{obj},
\item
otherwise, returns \tcode{make_obj_using_allocator<P>(std::forward<T>(obj), \exposid{alloc})}.
\end{itemize}
\end{itemdescr}

\rSec2[exec.snd.concepts]{Sender concepts}

\pnum
Expand Down Expand Up @@ -3515,7 +3545,8 @@
args_variant_t @\exposid{args}@; // \expos
ops2_variant_t @\exposid{ops2}@; // \expos
};
return @\exposid{state-type}@{std::forward_like<Sndr>(fn), @\exposid{let-env}@(child), {}, {}};
return @\exposid{state-type}@{@\exposid{allocator-aware-forward}@(std::forward_like<Sndr>(fn), rcvr),
@\exposid{let-env}@(child), {}, {}};
}
\end{codeblock}

Expand Down