Skip to content

Commit ae812bd

Browse files
committed
[exec.snd.expos] Reorder specification immediately after declaration
Fixes NB US 213-353 (C++26 CD).
1 parent 597cc85 commit ae812bd

File tree

1 file changed

+103
-79
lines changed

1 file changed

+103
-79
lines changed

source/exec.tex

Lines changed: 103 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,20 +1731,6 @@
17311731
concept @\defexposconceptnc{completion-tag}@ = // \expos
17321732
@\libconcept{same_as}@<Tag, set_value_t> || @\libconcept{same_as}@<Tag, set_error_t> || @\libconcept{same_as}@<Tag, set_stopped_t>;
17331733

1734-
struct @\exposidnc{default-impls}@ { // \expos
1735-
static constexpr auto @\exposidnc{get-attrs}@ = @\seebelownc@; // \expos
1736-
static constexpr auto @\exposidnc{get-env}@ = @\seebelownc@; // \expos
1737-
static constexpr auto @\exposidnc{get-state}@ = @\seebelownc@; // \expos
1738-
static constexpr auto @\exposidnc{start}@ = @\seebelownc@; // \expos
1739-
static constexpr auto @\exposidnc{complete}@ = @\seebelownc@; // \expos
1740-
1741-
template<class Sndr, class... Env>
1742-
static consteval void @\exposidnc{check-types}@(); // \expos
1743-
};
1744-
1745-
template<class Tag>
1746-
struct @\exposidnc{impls-for}@ : @\exposidnc{default-impls}@ {}; // \expos
1747-
17481734
template<class Sndr, class Rcvr> // \expos
17491735
using @\exposid{state-type}@ = decay_t<@\exposid{call-result-t}@<
17501736
decltype(@\exposid{impls-for}@<tag_of_t<Sndr>>::@\exposid{get-state}@), Sndr, Rcvr&>>;
@@ -1772,7 +1758,26 @@
17721758
Rcvr @\exposidnc{rcvr}@; // \expos
17731759
@\exposidnc{state-type}@<Sndr, Rcvr> @\exposidnc{state}@; // \expos
17741760
};
1761+
}
1762+
\end{codeblock}
1763+
1764+
\pnum
1765+
The expression in the \tcode{noexcept} clause of
1766+
the constructor of \exposid{basic-state} is
1767+
\begin{codeblock}
1768+
is_nothrow_move_constructible_v<Rcvr> &&
1769+
@\exposconcept{nothrow-callable}@<decltype(@\exposid{impls-for}@<tag_of_t<Sndr>>::@\exposid{get-state}@), Sndr, Rcvr&> &&
1770+
(@\libconcept{same_as}@<@\exposid{state-type}@<Sndr, Rcvr>, @\exposid{get-state-result}@> ||
1771+
is_nothrow_constructible_v<@\exposid{state-type}@<Sndr, Rcvr>, @\exposid{get-state-result}@>)
1772+
\end{codeblock}
1773+
where \exposid{get-state-result} is
1774+
\begin{codeblock}
1775+
@\exposid{call-result-t}@<decltype(@\exposid{impls-for}@<tag_of_t<Sndr>>::@\exposid{get-state}@), Sndr, Rcvr&>.
1776+
\end{codeblock}
17751777

1778+
\pnum
1779+
\begin{codeblock}
1780+
namespace std::execution {
17761781
template<class Sndr, class Rcvr, class Index>
17771782
requires @\exposconcept{valid-specialization}@<@\exposid{env-type}@, Index, Sndr, Rcvr>
17781783
struct @\exposidnc{basic-receiver}@ { // \expos
@@ -1805,77 +1810,19 @@
18051810

18061811
@\exposidnc{basic-state}@<Sndr, Rcvr>* @\exposidnc{op}@; // \expos
18071812
};
1813+
}
1814+
\end{codeblock}
18081815

1816+
\begin{codeblock}
1817+
namespace std::execution {
18091818
constexpr auto @\exposidnc{connect-all}@ = @\seebelownc@; // \expos
18101819

18111820
template<class Sndr, class Rcvr>
18121821
using @\exposidnc{connect-all-result}@ = @\exposidnc{call-result-t}@< // \expos
18131822
decltype(@\exposid{connect-all}@), @\exposid{basic-state}@<Sndr, Rcvr>*, Sndr, @\exposid{indices-for}@<Sndr>>;
1814-
1815-
template<class Sndr, class Rcvr>
1816-
requires @\exposconcept{valid-specialization}@<@\exposid{state-type}@, Sndr, Rcvr> &&
1817-
@\exposconcept{valid-specialization}@<@\exposid{connect-all-result}@, Sndr, Rcvr>
1818-
struct @\exposidnc{basic-operation}@ : @\exposidnc{basic-state}@<Sndr, Rcvr> { // \expos
1819-
using operation_state_concept = operation_state_t;
1820-
using @\exposidnc{tag-t}@ = tag_of_t<Sndr>; // \expos
1821-
1822-
@\exposidnc{connect-all-result}@<Sndr, Rcvr> @\exposidnc{inner-ops}@; // \expos
1823-
1824-
@\exposidnc{basic-operation}@(Sndr&& sndr, Rcvr&& rcvr) noexcept(@\seebelownc@) // \expos
1825-
: @\exposid{basic-state}@<Sndr, Rcvr>(std::forward<Sndr>(sndr), std::move(rcvr)),
1826-
@\exposid{inner-ops}@(@\exposid{connect-all}@(this, std::forward<Sndr>(sndr), @\exposid{indices-for}@<Sndr>()))
1827-
{}
1828-
1829-
void start() & noexcept {
1830-
auto& [...ops] = @\exposid{inner-ops}@;
1831-
@\exposid{impls-for}@<tag-t>::@\exposid{start}@(this->@\exposid{state}@, this->@\exposid{rcvr}@, ops...);
1832-
}
1833-
};
1834-
1835-
template<class Tag, class Data, class... Child>
1836-
struct @\exposidnc{basic-sender}@ : @\exposidnc{product-type}@<Tag, Data, Child...> { // \expos
1837-
using sender_concept = sender_t;
1838-
using @\exposidnc{indices-for}@ = index_sequence_for<Child...>; // \expos
1839-
1840-
decltype(auto) get_env() const noexcept {
1841-
auto& [_, data, ...child] = *this;
1842-
return @\exposid{impls-for}@<Tag>::@\exposid{get-attrs}@(data, child...);
1843-
}
1844-
1845-
template<@\exposconcept{decays-to}@<@\exposid{basic-sender}@> Self, @\libconcept{receiver}@ Rcvr>
1846-
auto connect(this Self&& self, Rcvr rcvr) noexcept(@\seebelow@)
1847-
-> @\exposid{basic-operation}@<Self, Rcvr> {
1848-
return {std::forward<Self>(self), std::move(rcvr)};
1849-
}
1850-
1851-
template<@\exposconcept{decays-to}@<@\exposid{basic-sender}@> Self, class... Env>
1852-
static constexpr auto get_completion_signatures();
1853-
};
18541823
}
18551824
\end{codeblock}
18561825

1857-
\pnum
1858-
It is unspecified whether a specialization of \exposid{basic-sender}
1859-
is an aggregate.
1860-
1861-
\pnum
1862-
An expression of type \exposid{basic-sender} is usable as
1863-
the initializer of a structured binding declaration\iref{dcl.struct.bind}.
1864-
1865-
\pnum
1866-
The expression in the \tcode{noexcept} clause of
1867-
the constructor of \exposid{basic-state} is
1868-
\begin{codeblock}
1869-
is_nothrow_move_constructible_v<Rcvr> &&
1870-
@\exposconcept{nothrow-callable}@<decltype(@\exposid{impls-for}@<tag_of_t<Sndr>>::@\exposid{get-state}@), Sndr, Rcvr&> &&
1871-
(@\libconcept{same_as}@<@\exposid{state-type}@<Sndr, Rcvr>, @\exposid{get-state-result}@> ||
1872-
is_nothrow_constructible_v<@\exposid{state-type}@<Sndr, Rcvr>, @\exposid{get-state-result}@>)
1873-
\end{codeblock}
1874-
where \exposid{get-state-result} is
1875-
\begin{codeblock}
1876-
@\exposid{call-result-t}@<decltype(@\exposid{impls-for}@<tag_of_t<Sndr>>::@\exposid{get-state}@), Sndr, Rcvr&>.
1877-
\end{codeblock}
1878-
18791826
\pnum
18801827
The object \exposid{connect-all} is initialized with
18811828
a callable object equivalent to the following lambda:
@@ -1902,6 +1849,31 @@
19021849
otherwise, \tcode{false}.
19031850
\end{itemdescr}
19041851

1852+
\pnum
1853+
\begin{codeblock}
1854+
namespace std::execution {
1855+
template<class Sndr, class Rcvr>
1856+
requires @\exposconcept{valid-specialization}@<@\exposid{state-type}@, Sndr, Rcvr> &&
1857+
@\exposconcept{valid-specialization}@<@\exposid{connect-all-result}@, Sndr, Rcvr>
1858+
struct @\exposidnc{basic-operation}@ : @\exposidnc{basic-state}@<Sndr, Rcvr> { // \expos
1859+
using operation_state_concept = operation_state_t;
1860+
using @\exposidnc{tag-t}@ = tag_of_t<Sndr>; // \expos
1861+
1862+
@\exposidnc{connect-all-result}@<Sndr, Rcvr> @\exposidnc{inner-ops}@; // \expos
1863+
1864+
@\exposidnc{basic-operation}@(Sndr&& sndr, Rcvr&& rcvr) noexcept(@\seebelownc@) // \expos
1865+
: @\exposid{basic-state}@<Sndr, Rcvr>(std::forward<Sndr>(sndr), std::move(rcvr)),
1866+
@\exposid{inner-ops}@(@\exposid{connect-all}@(this, std::forward<Sndr>(sndr), @\exposid{indices-for}@<Sndr>()))
1867+
{}
1868+
1869+
void start() & noexcept {
1870+
auto& [...ops] = @\exposid{inner-ops}@;
1871+
@\exposid{impls-for}@<tag-t>::@\exposid{start}@(this->@\exposid{state}@, this->@\exposid{rcvr}@, ops...);
1872+
}
1873+
};
1874+
}
1875+
\end{codeblock}
1876+
19051877
\pnum
19061878
The expression in the \tcode{noexcept} clause of
19071879
the constructor of \exposid{basic-operation} is:
@@ -1911,10 +1883,22 @@
19111883
\end{codeblock}
19121884

19131885
\pnum
1914-
The expression in the \tcode{noexcept} clause of
1915-
the \tcode{connect} member function of \exposid{basic-sender} is:
19161886
\begin{codeblock}
1917-
is_nothrow_constructible_v<@\exposid{basic-operation}@<Self, Rcvr>, Self, Rcvr>
1887+
namespace std::execution {
1888+
struct @\exposidnc{default-impls}@ { // \expos
1889+
static constexpr auto @\exposidnc{get-attrs}@ = @\seebelownc@; // \expos
1890+
static constexpr auto @\exposidnc{get-env}@ = @\seebelownc@; // \expos
1891+
static constexpr auto @\exposidnc{get-state}@ = @\seebelownc@; // \expos
1892+
static constexpr auto @\exposidnc{start}@ = @\seebelownc@; // \expos
1893+
static constexpr auto @\exposidnc{complete}@ = @\seebelownc@; // \expos
1894+
1895+
template<class Sndr, class... Env>
1896+
static consteval void @\exposidnc{check-types}@(); // \expos
1897+
};
1898+
1899+
template<class Tag>
1900+
struct @\exposidnc{impls-for}@ : @\exposidnc{default-impls}@ {}; // \expos
1901+
}
19181902
\end{codeblock}
19191903

19201904
\pnum
@@ -2004,6 +1988,46 @@
20041988
\end{note}
20051989
\end{itemdescr}
20061990

1991+
\pnum
1992+
\begin{codeblock}
1993+
namespace std::execution {
1994+
template<class Tag, class Data, class... Child>
1995+
struct @\exposidnc{basic-sender}@ : @\exposidnc{product-type}@<Tag, Data, Child...> { // \expos
1996+
using sender_concept = sender_t;
1997+
using @\exposidnc{indices-for}@ = index_sequence_for<Child...>; // \expos
1998+
1999+
decltype(auto) get_env() const noexcept {
2000+
auto& [_, data, ...child] = *this;
2001+
return @\exposid{impls-for}@<Tag>::@\exposid{get-attrs}@(data, child...);
2002+
}
2003+
2004+
template<@\exposconcept{decays-to}@<@\exposid{basic-sender}@> Self, @\libconcept{receiver}@ Rcvr>
2005+
auto connect(this Self&& self, Rcvr rcvr) noexcept(@\seebelow@)
2006+
-> @\exposid{basic-operation}@<Self, Rcvr> {
2007+
return {std::forward<Self>(self), std::move(rcvr)};
2008+
}
2009+
2010+
template<@\exposconcept{decays-to}@<@\exposid{basic-sender}@> Self, class... Env>
2011+
static constexpr auto get_completion_signatures();
2012+
};
2013+
}
2014+
\end{codeblock}
2015+
2016+
\pnum
2017+
It is unspecified whether a specialization of \exposid{basic-sender}
2018+
is an aggregate.
2019+
2020+
\pnum
2021+
An expression of type \exposid{basic-sender} is usable as
2022+
the initializer of a structured binding declaration\iref{dcl.struct.bind}.
2023+
2024+
\pnum
2025+
The expression in the \tcode{noexcept} clause of
2026+
the \tcode{connect} member function of \exposid{basic-sender} is:
2027+
\begin{codeblock}
2028+
is_nothrow_constructible_v<@\exposid{basic-operation}@<Self, Rcvr>, Self, Rcvr>
2029+
\end{codeblock}
2030+
20072031
\indexlibrarymember{get_completion_signatures}{\exposid{basic-sender}}%
20082032
\begin{itemdecl}
20092033
template<class Tag, class Data, class... Child>

0 commit comments

Comments
 (0)