|
5394 | 5394 | void @\exposid{abandon}@() noexcept; // \expos |
5395 | 5395 |
|
5396 | 5396 | private: |
5397 | | - using @\exposid{alloc-t}@ = // \expos |
5398 | | - allocator_traits<Alloc>::template rebind_alloc<@\exposid{spawn-future-state}@>; |
5399 | 5397 | using @\exposid{assoc-t}@ = remove_cvref_t<decltype(declval<Token&>().try_associate())>; // \expos |
5400 | 5398 |
|
5401 | | - |
5402 | | - @\exposid{alloc-t}@ @\exposid{alloc}@; // \expos |
| 5399 | + Alloc @\exposid{alloc}@; // \expos |
5403 | 5400 | @\exposid{ssource-t}@ @\exposid{ssource}@; // \expos |
5404 | 5401 | @\exposid{op-t}@ @\exposid{op}@; // \expos |
5405 | 5402 | @\exposid{assoc-t}@ @\exposid{assoc}@; // \expos |
5406 | 5403 |
|
5407 | 5404 | void @\exposid{destroy}@() noexcept; // \expos |
5408 | 5405 | }; |
| 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>; |
5409 | 5410 | } |
5410 | 5411 | \end{codeblock} |
5411 | 5412 |
|
|
5504 | 5505 | \effects |
5505 | 5506 | Equivalent to: |
5506 | 5507 | \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 | +} |
5511 | 5515 | \end{codeblock} |
5512 | 5516 | \end{itemdescr} |
5513 | 5517 |
|
|
5561 | 5565 |
|
5562 | 5566 | \begin{itemize} |
5563 | 5567 | \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))} |
5566 | 5570 | from \tcode{alloc}, \tcode{token.wrap(sndr)}, \tcode{token}, and \tcode{senv}. |
5567 | 5571 | If an exception is thrown then |
5568 | 5572 | any constructed objects are destroyed and |
|
5902 | 5906 | void @\exposid{run}@() noexcept; // \expos |
5903 | 5907 |
|
5904 | 5908 | private: |
5905 | | - using @\exposid{alloc-t}@ = // \expos |
5906 | | - allocator_traits<Alloc>::template rebind_alloc<@\exposid{spawn-state}@>; |
5907 | 5909 | using @\exposid{assoc-t}@ = // \expos |
5908 | 5910 | remove_cvref_t<decltype(declval<Token&>().try_associate())>; |
5909 | 5911 |
|
5910 | | - @\exposid{alloc-t}@ @\exposid{alloc}@; // \expos |
| 5912 | + Alloc @\exposid{alloc}@; // \expos |
5911 | 5913 | @\exposid{op-t}@ @\exposid{op}@; // \expos |
5912 | 5914 | @\exposid{assoc-t}@ @\exposid{assoc}@; // \expos |
5913 | 5915 | }; |
|
5956 | 5958 | Equivalent to: |
5957 | 5959 | \begin{codeblock} |
5958 | 5960 | 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 | +} |
5962 | 5967 | \end{codeblock} |
5963 | 5968 | \end{itemdescr} |
5964 | 5969 |
|
|
5988 | 5993 | %%FIXME: Was this supposed to be more than a single bullet? |
5989 | 5994 | \begin{itemize} |
5990 | 5995 | \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} |
5994 | 5999 | and then |
5995 | 6000 | invokes \tcode{o.\exposid{run}()}. |
5996 | 6001 | If an exception is thrown then |
|
0 commit comments