Skip to content

Commit e421465

Browse files
eisenwavetkoeppe
authored andcommitted
P3923R0: Re NB US 227-346 and US 229-347 (C++26 CD)
Fixes NB US 227-346, US 229-347 (C++26 CD).
1 parent 3d09520 commit e421465

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

source/exec.tex

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5394,18 +5394,19 @@
53945394
void @\exposid{abandon}@() noexcept; // \expos
53955395

53965396
private:
5397-
using @\exposid{alloc-t}@ = // \expos
5398-
allocator_traits<Alloc>::template rebind_alloc<@\exposid{spawn-future-state}@>;
53995397
using @\exposid{assoc-t}@ = remove_cvref_t<decltype(declval<Token&>().try_associate())>; // \expos
54005398

5401-
5402-
@\exposid{alloc-t}@ @\exposid{alloc}@; // \expos
5399+
Alloc @\exposid{alloc}@; // \expos
54035400
@\exposid{ssource-t}@ @\exposid{ssource}@; // \expos
54045401
@\exposid{op-t}@ @\exposid{op}@; // \expos
54055402
@\exposid{assoc-t}@ @\exposid{assoc}@; // \expos
54065403

54075404
void @\exposid{destroy}@() noexcept; // \expos
54085405
};
5406+
5407+
template<class Alloc, @\libconcept{scope_token}@ Token, @\libconcept{sender}@ Sender, class Env> // \expos
5408+
@\exposid{spawn-future-state}@(Alloc alloc, Sender&& sndr, Token token, Env env)
5409+
-> @\exposid{spawn-future-state}@<Alloc, Token, Sender, Env>;
54095410
}
54105411
\end{codeblock}
54115412

@@ -5504,10 +5505,13 @@
55045505
\effects
55055506
Equivalent to:
55065507
\begin{codeblock}
5507-
auto assoc = std::move(this->@\exposid{assoc}@);
5508-
auto alloc = std::move(this->@\exposid{alloc}@);
5509-
allocator_traits<@\exposid{alloc-t}@>::destroy(alloc, this);
5510-
allocator_traits<@\exposid{alloc-t}@>::deallocate(alloc, this, 1);
5508+
auto associated = std::move(this->@\exposid{associated}@);
5509+
{
5510+
using traits = allocator_traits<Alloc>::template rebind_traits<@\exposid{spawn-future-state}@>;
5511+
typename traits::allocator_type alloc(std::move(this->@\exposid{alloc}@));
5512+
traits::destroy(alloc, this);
5513+
traits::deallocate(alloc, this, 1);
5514+
}
55115515
\end{codeblock}
55125516
\end{itemdescr}
55135517

@@ -5561,8 +5565,8 @@
55615565

55625566
\begin{itemize}
55635567
\item
5564-
Uses \tcode{alloc} to allocate and construct an object \tcode{s} of
5565-
a type that is a specialization of \exposid{spawn-future-\brk{}state}
5568+
Uses \tcode{alloc} to allocate and construct an object \tcode{s} of type
5569+
\tcode{decltype(\exposid{spawn-future-state}(alloc, token.wrap(sndr), token, senv))}
55665570
from \tcode{alloc}, \tcode{token.wrap(sndr)}, \tcode{token}, and \tcode{senv}.
55675571
If an exception is thrown then
55685572
any constructed objects are destroyed and
@@ -5902,12 +5906,10 @@
59025906
void @\exposid{run}@() noexcept; // \expos
59035907

59045908
private:
5905-
using @\exposid{alloc-t}@ = // \expos
5906-
allocator_traits<Alloc>::template rebind_alloc<@\exposid{spawn-state}@>;
59075909
using @\exposid{assoc-t}@ = // \expos
59085910
remove_cvref_t<decltype(declval<Token&>().try_associate())>;
59095911

5910-
@\exposid{alloc-t}@ @\exposid{alloc}@; // \expos
5912+
Alloc @\exposid{alloc}@; // \expos
59115913
@\exposid{op-t}@ @\exposid{op}@; // \expos
59125914
@\exposid{assoc-t}@ @\exposid{assoc}@; // \expos
59135915
};
@@ -5956,9 +5958,12 @@
59565958
Equivalent to:
59575959
\begin{codeblock}
59585960
auto assoc = std::move(this->@\exposid{assoc}@);
5959-
auto alloc = std::move(this->@\exposid{alloc}@);
5960-
allocator_traits<@\exposid{alloc-t}@>::destroy(alloc, this);
5961-
allocator_traits<@\exposid{alloc-t}@>::deallocate(alloc, this, 1);
5961+
{
5962+
using traits = allocator_traits<Alloc>::template rebind_traits<@\exposid{spawn-state}@>;
5963+
typename traits::allocator_type alloc(this->@\exposid{alloc}@);
5964+
traits::destroy(alloc, this);
5965+
traits::deallocate(alloc, this, 1);
5966+
}
59625967
\end{codeblock}
59635968
\end{itemdescr}
59645969

@@ -5988,9 +5993,9 @@
59885993
%%FIXME: Was this supposed to be more than a single bullet?
59895994
\begin{itemize}
59905995
\item
5991-
Uses \tcode{alloc} to allocate and construct an object \tcode{o} of
5992-
type that is a specialization of \tcode{\exposid{spawn-state}} from
5993-
\tcode{alloc}, \tcode{write_env(token.wrap(sndr), senv)}, and \tcode{token}
5996+
Uses \tcode{alloc} to allocate and construct an object \tcode{o} of type
5997+
\tcode{decltype(\exposid{spawn-state}(alloc, write_env(token.wrap(sndr), senv), token))}
5998+
from \tcode{alloc}, \tcode{write_env(token.wrap(sndr), senv)}, and \tcode{token}
59945999
and then
59956000
invokes \tcode{o.\exposid{run}()}.
59966001
If an exception is thrown then

0 commit comments

Comments
 (0)