Skip to content

Commit a586131

Browse files
committed
P3923R0: Re NB US 227-346 and US 229-347 (C++26 CD)
Fixes NB US 227-346 and US 229-347 (C++26 CD).
1 parent e87003d commit a586131

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

source/exec.tex

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5385,17 +5385,18 @@
53855385
void @\exposid{abandon}@() noexcept; // \expos
53865386

53875387
private:
5388-
using @\exposid{alloc-t}@ = // \expos
5389-
allocator_traits<Alloc>::template rebind_alloc<@\exposid{spawn-future-state}@>;
5390-
5391-
@\exposid{alloc-t}@ @\exposid{alloc}@; // \expos
5388+
Alloc @\exposid{alloc}@; // \expos
53925389
@\exposid{ssource-t}@ @\exposid{ssource}@; // \expos
53935390
@\exposid{op-t}@ @\exposid{op}@; // \expos
53945391
Token @\exposid{token}@; // \expos
53955392
bool @\exposid{associated}@; // \expos
53965393

53975394
void @\exposid{destroy}@() noexcept; // \expos
53985395
};
5396+
5397+
template<class Alloc, scope_token Token, sender Sender, class Env> // \expos
5398+
\exposid{spawn-future-state}(Alloc alloc, Sender&& sndr, Token token, Env env)
5399+
-> \exposid{spawn-future-state}<Alloc, Token, Sender, Env>;
53995400
}
54005401
\end{codeblock}
54015402

@@ -5498,10 +5499,10 @@
54985499
bool associated = this->@\exposid{associated}@;
54995500

55005501
{
5501-
auto alloc = std::move(this->@\exposid{alloc}@);
5502-
5503-
allocator_traits<@\exposid{alloc-t}@>::destroy(alloc, this);
5504-
allocator_traits<@\exposid{alloc-t}@>::deallocate(alloc, this, 1);
5502+
using traits = allocator_traits<Alloc>::template rebind_traits<\exposid{spawn-future-state}>;
5503+
typename traits::allocator_type alloc(std::move(this->\exposid{alloc}));
5504+
traits::destroy(alloc, this);
5505+
traits::deallocate(alloc, this, 1);
55055506
}
55065507

55075508
if (associated)
@@ -5559,8 +5560,8 @@
55595560

55605561
\begin{itemize}
55615562
\item
5562-
Uses \tcode{alloc} to allocate and construct an object \tcode{s} of
5563-
a type that is a specialization of \exposid{spawn-future-\brk{}state}
5563+
Uses \tcode{alloc} to allocate and construct an object \tcode{s} of type
5564+
\tcode{decltype(\exposid{spawn-future-state}(alloc, token.wrap(sndr), token, senv))}
55645565
from \tcode{alloc}, \tcode{token.wrap(sndr)}, \tcode{token}, and \tcode{senv}.
55655566
If an exception is thrown then
55665567
any constructed objects are destroyed and
@@ -5900,10 +5901,7 @@
59005901
void @\exposid{run}@(); // \expos
59015902

59025903
private:
5903-
using @\exposid{alloc-t}@ = // \expos
5904-
allocator_traits<Alloc>::template rebind_alloc<@\exposid{spawn-state}@>;
5905-
5906-
@\exposid{alloc-t}@ @\exposid{alloc}@; // \expos
5904+
Alloc @\exposid{alloc}@; // \expos
59075905
@\exposid{op-t}@ @\exposid{op}@; // \expos
59085906
Token @\exposid{token}@; // \expos
59095907

@@ -5973,10 +5971,10 @@
59735971
\effects
59745972
Equivalent to:
59755973
\begin{codeblock}
5976-
auto alloc = std::move(this->@\exposid{alloc}@);
5977-
5978-
allocator_traits<@\exposid{alloc-t}@>::destroy(alloc, this);
5979-
allocator_traits<@\exposid{alloc-t}@>::deallocate(alloc, this, 1);
5974+
using traits = allocator_traits<Alloc>::template rebind_traits<\exposid{spawn-state}>;
5975+
typename traits::allocator_type alloc(std::move(this->\exposid{alloc}));
5976+
traits::destroy(alloc, this);
5977+
traits::deallocate(alloc, this, 1);
59805978
\end{codeblock}
59815979
\end{itemdescr}
59825980

@@ -6006,9 +6004,9 @@
60066004
%%FIXME: Was this supposed to be more than a single bullet?
60076005
\begin{itemize}
60086006
\item
6009-
Uses \tcode{alloc} to allocate and construct an object \tcode{o} of
6010-
type that is a specialization of \tcode{\exposid{spawn-state}} from
6011-
\tcode{alloc}, \tcode{write_env(token.wrap(sndr), senv)}, and \tcode{token}
6007+
Uses \tcode{alloc} to allocate and construct an object \tcode{o} of type
6008+
\tcode{decltype(\exposid{spawn-state}(alloc, write_env(token.wrap(sndr), senv), token))}
6009+
from \tcode{alloc}, \tcode{write_env(token.wrap(sndr), senv)}, and \tcode{token}
60126010
and then
60136011
invokes \tcode{o.\exposid{run}()}.
60146012
If an exception is thrown then

0 commit comments

Comments
 (0)