Skip to content
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
89 changes: 45 additions & 44 deletions source/exec.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7331,6 +7331,13 @@
@\exposid{state}@<Rcvr> connect(Rcvr&& recv) &&;
\end{itemdecl}
\begin{itemdescr}
\pnum
\mandates
At least one of the expressions
\tcode{allocator_type(get_allocator(get_env(rcvr)))} and
\tcode{allocator_type()}
is well-formed.

\pnum
\expects
\tcode{bool(\exposid{handle})} is \tcode{true}.
Expand Down Expand Up @@ -7458,9 +7465,6 @@
template<class T, class Environment>
class task<T, Environment>::promise_type {
public:
template<class... Args>
promise_type(const Args&... args);

task get_return_object() noexcept;

static constexpr suspend_always @\libmember{initial_suspend}{task::promise_type}@() noexcept { return {}; }
Expand All @@ -7483,15 +7487,17 @@

@\unspec@ get_env() const noexcept;

template<class... Args>
void* operator new(size_t size, Args&&... args);
void* operator new(size_t size);
template<class Alloc, class... Args>
void* operator new(size_t size, allocator_arg_t, Alloc alloc, Args&&...);
template<class This, class Alloc, class... Args>
void* operator new(size_t size, const This&, allocator_arg_t, Alloc alloc, Args&&...);

void operator delete(void* pointer, size_t size) noexcept;

private:
using @\exposidnc{error-variant}@ = @\seebelownc@; // \expos

allocator_type @\exposidnc{alloc}@; // \expos
stop_source_type @\exposidnc{source}@; // \expos
stop_token_type @\exposidnc{token}@; // \expos
optional<T> @\exposidnc{result}@; // \expos; present only if \tcode{is_void_v<T>} is \tcode{false}
Expand Down Expand Up @@ -7519,25 +7525,6 @@
\tcode{execution::completion_signatures} denoted by
\tcode{error_types}.

\indexlibraryctor{task::promise_type}%
\begin{itemdecl}
template<class... Args>
promise_type(const Args&... args);
\end{itemdecl}
\begin{itemdescr}
\pnum
\mandates
The first parameter of type \tcode{allocator_arg_t} (if any) is not
the last parameter.

\pnum
\effects
If \tcode{Args} contains an element of type \tcode{allocator_arg_t}
then \exposid{alloc} is initialized with the corresponding next
element of \tcode{args}.
Otherwise, \exposid{alloc} is initialized with \tcode{allocator_type()}.
\end{itemdescr}

\indexlibrarymember{get_return_object}{task::promise_type}%
\begin{itemdecl}
task get_return_object() noexcept;
Expand Down Expand Up @@ -7679,10 +7666,19 @@
\returns
An object \tcode{env} such that queries are forwarded as follows:
\begin{itemize}
\item \tcode{env.query(get_scheduler)} returns \tcode{scheduler_type(\exposid{SCHED}(*this))}.
\item \tcode{env.query(get_allocator)} returns \exposid{alloc}.
\item \tcode{env.query(get_stop_token)} returns \exposid{token}.
\item For any other query \tcode{q} and arguments \tcode{a...} a
\item
\tcode{env.query(get_scheduler)} returns
\tcode{scheduler_type(\exposid{SCHED}(*this))}.
\item
\tcode{env.query(get_allocator)} returns
\tcode{allocator_type(get_allocator(get_env(\exposid{RCVR}(*this))\brk{}))}
if this expression is well-formed and
\tcode{allocator_type()} otherwise.
\item
\tcode{env.query(get_stop_token)}
returns \exposid{token}.
\item
For any other query \tcode{q} and arguments \tcode{a...} a
call to \tcode{env.query(q, a...)} returns
\tcode{\exposid{STATE}(*this)}. \tcode{environment.query(q, a...)} if this expression
is well-formed and \tcode{forwarding_query(q)} is well-formed and is \tcode{true}.
Expand All @@ -7692,28 +7688,33 @@

\indexlibrarymember{operator new}{task::promise_type}%
\begin{itemdecl}
template<class... Args>
void* operator new(size_t size, const Args&... args);
void* operator new(size_t size);
\end{itemdecl}

\begin{itemdescr}
\pnum
If there is no parameter with type \tcode{allocator_arg_t} then let
\tcode{alloc} be \tcode{allocator_type()}.
Otherwise, let \tcode{arg_next} be the parameter
following the first \tcode{allocator_arg_t} parameter,
and let \tcode{alloc} be \tcode{allocator_type(arg_next)}.
Let \tcode{PAlloc} be \tcode{allocator_traits<allocator_type>::template
rebind_alloc<U>}, where \tcode{U} is an unspecified type
\effects
Equivalent to:
\tcode{return operator new(size, allocator_arg, allocator_type());}
\end{itemdescr}

\indexlibrarymember{operator new}{task::promise_type}%
\begin{itemdecl}
template<class Alloc, class... Args>
void* operator new(size_t size, allocator_arg_t, Alloc alloc, Args&&...);
template<class This, class Alloc, class... Args>
void* operator new(size_t size, const This&, allocator_arg_t, Alloc alloc, Args&&...);
\end{itemdecl}
\begin{itemdescr}
\pnum
Let \tcode{PAlloc} be
\tcode{allocator_traits<Alloc>::template rebind_alloc<U>},
where \tcode{U} is an unspecified type
whose size and alignment are both \mname{STDCPP_DEFAULT_NEW_ALIGNMENT}.

\pnum
\mandates
\begin{itemize}
\item The first parameter of type \tcode{allocator_arg_t} (if any) is not the last parameter.
\item \tcode{allocator_type(arg_next)} is a valid expression if there is a parameter
of type \tcode{allocator_arg_t}.
\item \tcode{allocator_traits<PAlloc>::pointer} is a pointer type.
\end{itemize}
\tcode{allocator_traits<PAlloc>::pointer} is a pointer type.

\pnum
\effects
Expand Down
Loading