diff --git a/source/exec.tex b/source/exec.tex index 88aa84b9e5..47ac14dfc2 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -7644,6 +7644,13 @@ @\exposid{state}@ 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}. @@ -7784,9 +7791,6 @@ template class task::promise_type { public: - template - promise_type(const Args&... args); - task get_return_object() noexcept; static constexpr suspend_always @\libmember{initial_suspend}{task::promise_type}@() noexcept { return {}; } @@ -7809,15 +7813,16 @@ @\unspec@ get_env() const noexcept; - template - void* operator new(size_t size, Args&&... args); + void* operator new(size_t size); + template + void* operator new(size_t size, allocator_arg_t, Alloc alloc, Args&&...); + template + 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} @@ -7834,25 +7839,6 @@ during evaluation of \tcode{task::\exposid{state}::start} for some receiver \tcode{Rcvr}. -\indexlibraryctor{task::promise_type}% -\begin{itemdecl} -template - 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; @@ -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 @@ -8020,28 +8009,33 @@ \indexlibrarymember{operator new}{task::promise_type}% \begin{itemdecl} -template - 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 + void* operator new(size_t size, allocator_arg_t, Alloc alloc, Args&&...); +template + 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::template -rebind_alloc}, where \tcode{U} is an unspecified type +Let \tcode{PAlloc} be +\tcode{allocator_traits::template rebind_alloc}, +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::pointer} is a pointer type. -\end{itemize} +\tcode{allocator_traits::pointer} is a pointer type. \pnum \effects