|
5385 | 5385 | void @\exposid{abandon}@() noexcept; // \expos |
5386 | 5386 |
|
5387 | 5387 | 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 |
5392 | 5389 | @\exposid{ssource-t}@ @\exposid{ssource}@; // \expos |
5393 | 5390 | @\exposid{op-t}@ @\exposid{op}@; // \expos |
5394 | 5391 | Token @\exposid{token}@; // \expos |
5395 | 5392 | bool @\exposid{associated}@; // \expos |
5396 | 5393 |
|
5397 | 5394 | void @\exposid{destroy}@() noexcept; // \expos |
5398 | 5395 | }; |
| 5396 | + |
| 5397 | + template<class Alloc, @\libconcept{scope_token}@ Token, @\libconcept{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>; |
5399 | 5400 | } |
5400 | 5401 | \end{codeblock} |
5401 | 5402 |
|
|
5498 | 5499 | bool associated = this->@\exposid{associated}@; |
5499 | 5500 |
|
5500 | 5501 | { |
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); |
5505 | 5506 | } |
5506 | 5507 |
|
5507 | 5508 | if (associated) |
|
5559 | 5560 |
|
5560 | 5561 | \begin{itemize} |
5561 | 5562 | \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))} |
5564 | 5565 | from \tcode{alloc}, \tcode{token.wrap(sndr)}, \tcode{token}, and \tcode{senv}. |
5565 | 5566 | If an exception is thrown then |
5566 | 5567 | any constructed objects are destroyed and |
|
5900 | 5901 | void @\exposid{run}@(); // \expos |
5901 | 5902 |
|
5902 | 5903 | 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 |
5907 | 5905 | @\exposid{op-t}@ @\exposid{op}@; // \expos |
5908 | 5906 | Token @\exposid{token}@; // \expos |
5909 | 5907 |
|
|
5973 | 5971 | \effects |
5974 | 5972 | Equivalent to: |
5975 | 5973 | \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); |
5980 | 5978 | \end{codeblock} |
5981 | 5979 | \end{itemdescr} |
5982 | 5980 |
|
|
6006 | 6004 | %%FIXME: Was this supposed to be more than a single bullet? |
6007 | 6005 | \begin{itemize} |
6008 | 6006 | \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} |
6012 | 6010 | and then |
6013 | 6011 | invokes \tcode{o.\exposid{run}()}. |
6014 | 6012 | If an exception is thrown then |
|
0 commit comments