Skip to content

Commit 05c2eb8

Browse files
burblebeetkoeppe
authored andcommitted
LWG4175 get_env() specified in terms of as_const() but this doesn't work with rvalue senders
1 parent 3506bbe commit 05c2eb8

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

source/exec.tex

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@
101101
Otherwise, \tcode{make_exception_ptr(err)}.
102102
\end{itemize}
103103

104+
\pnum
105+
For a subexpression \tcode{expr},
106+
let \tcode{\exposid{AS-CONST}(expr)} be expression-equivalent to
107+
\begin{codeblock}
108+
[](const auto& x) noexcept -> const auto& { return x; }(expr)
109+
\end{codeblock}
110+
104111
\rSec1[exec.queryable]{Queries and queryables}
105112

106113
\rSec2[exec.queryable.general]{General}
@@ -789,7 +796,7 @@
789796
The name \tcode{get_allocator} denotes a query object.
790797
For a subexpression \tcode{env},
791798
\tcode{get_allocator(env)} is expression-equivalent to
792-
\tcode{\exposid{MANDATE-NOTHROW}(as_const(env).query(get_allocator))}.
799+
\tcode{\exposid{MANDATE-NOTHROW}(\exposid{AS-CONST}(env).query(get_allocator))}.
793800

794801
\mandates
795802
If the expression above is well-formed,
@@ -811,7 +818,7 @@
811818
\tcode{get_stop_token(env)} is expression-equivalent to:
812819
\begin{itemize}
813820
\item
814-
\tcode{\exposid{MANDATE-NOTHROW}(as_const(env).query(get_stop_token))}
821+
\tcode{\exposid{MANDATE-NOTHROW}(\exposid{AS-CONST}(env).query(get_stop_token))}
815822
if that expression is well-formed.
816823

817824
\mandates
@@ -833,7 +840,7 @@
833840
\tcode{execution::get_env(o)} is expression-equivalent to:
834841
\begin{itemize}
835842
\item
836-
\tcode{\exposid{MANDATE-NOTHROW}(as_const(o).get_env())}
843+
\tcode{\exposid{MANDATE-NOTHROW}(\exposid{AS-CONST}(o).get_env())}
837844
if that expression is well-formed.
838845

839846
\mandates
@@ -864,7 +871,7 @@
864871
The name \tcode{get_domain} denotes a query object.
865872
For a subexpression \tcode{env},
866873
\tcode{get_domain(env)} is expression-equivalent to
867-
\tcode{\exposid{MANDATE-NOTHROW}(as_const(env).query(get_domain))}.
874+
\tcode{\exposid{MANDATE-NOTHROW}(\exposid{AS-CONST}(env).query(get_domain))}.
868875

869876
\pnum
870877
\tcode{forwarding_query(execution::get_domain)} is
@@ -879,7 +886,7 @@
879886
The name \tcode{get_scheduler} denotes a query object.
880887
For a subexpression \tcode{env},
881888
\tcode{get_scheduler(env)} is expression-equivalent to
882-
\tcode{\exposid{MANDATE-NOTHROW}(as_const(env).query(get_scheduler))}.
889+
\tcode{\exposid{MANDATE-NOTHROW}(\exposid{AS-CONST}(env).query(get_scheduler))}.
883890

884891
\mandates
885892
If the expression above is well-formed,
@@ -900,7 +907,7 @@
900907
The name \tcode{get_delegation_scheduler} denotes a query object.
901908
For a subexpression \tcode{env},
902909
\tcode{get_delegation_scheduler(env)} is expression-equivalent to
903-
\tcode{\exposid{MANDATE-NOTHROW}(as_const(env).query(get_delegation_scheduler))}.
910+
\tcode{\exposid{MANDATE-NOTHROW}(\exposid{AS-CONST}(env).query(get_delegation_scheduler))}.
904911

905912
\mandates
906913
If the expression above is well-formed,
@@ -936,7 +943,7 @@
936943
\tcode{get_forward_progress_guarantee(sch)} is expression-equivalent to:
937944
\begin{itemize}
938945
\item
939-
\tcode{\exposid{MANDATE-NOTHROW}(as_const(sch).query(get_forward_progress_guarantee))},
946+
\tcode{\exposid{MANDATE-NOTHROW}(\exposid{AS-CONST}(sch).query(get_forward_progress_guarantee))},
940947
if that expression is well-formed.
941948

942949
\mandates
@@ -970,7 +977,7 @@
970977
Otherwise, \tcode{get_completion_scheduler<\exposid{completion-tag}>(q)}
971978
is expression-equivalent to
972979
\begin{codeblock}
973-
@\exposid{MANDATE-NOTHROW}@(as_const(q).query(get_completion_scheduler<@\exposid{completion-tag}@>))
980+
@\exposid{MANDATE-NOTHROW}@(@\exposid{AS-CONST}@(q).query(get_completion_scheduler<@\exposid{completion-tag}@>))
974981
\end{codeblock}
975982
\mandates
976983
If the expression above is well-formed,

0 commit comments

Comments
 (0)