Skip to content
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
78 changes: 36 additions & 42 deletions source/exec.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7644,6 +7644,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 @@ -7784,9 +7791,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 @@ -7809,15 +7813,16 @@

@\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
};
}
\end{codeblock}
Expand All @@ -7834,25 +7839,6 @@
during evaluation of \tcode{task::\exposid{state}<Rcvr>::start}
for some receiver \tcode{Rcvr}.

\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 @@ -8007,7 +7993,10 @@
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_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
\tcode{\exposid{STATE}(*this).\exposid{get-stop-token}()}.
\item For any other query \tcode{q} and arguments \tcode{a...} a
Expand All @@ -8020,28 +8009,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
\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
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
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