diff --git a/source/algorithms.tex b/source/algorithms.tex index 5218902777..92ed2c1d25 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -7839,9 +7839,11 @@ \pnum Let \tcode{pred} be \tcode{equal_to\{\}} for the overloads with no parameter \tcode{pred}, and -let $E$ be +let $E(\tcode{i})$ be \begin{itemize} \setlength{\emergencystretch}{1em} +\item + \tcode{false} if \tcode{i} is equal to \tcode{first}; otherwise \item \tcode{bool(pred(*(i - 1), *i))} for the overloads in namespace \tcode{std}; @@ -7859,10 +7861,9 @@ \pnum \effects -For a nonempty range, eliminates all but the first element -from every consecutive group of equivalent elements referred to +Eliminates all elements referred to by the iterator \tcode{i} in the range \range{first + 1}{last} -for which $E$ is \tcode{true}. +for which $E(\tcode{i})$ is \tcode{true}. \pnum \returns @@ -7942,6 +7943,8 @@ let $E(\tcode{i})$ be \begin{itemize} \setlength{\emergencystretch}{1em} +\item + \tcode{false} if \tcode{i} is equal to \tcode{first}; otherwise \item \tcode{bool(pred(*i, *(i - 1)))} for the overloads in namespace \tcode{std}; @@ -7954,13 +7957,13 @@ Let: \begin{itemize} \item - $M$ be the number of iterators \tcode{i} in the range \range{first + 1}{last} + $M$ be the number of iterators \tcode{i} in the range \range{first}{last} for which $E(\tcode{i})$ is \tcode{false}; \item - \tcode{result_last} be \tcode{result + $M$ + 1} + \tcode{result_last} be \tcode{result + $M$} for the overloads with no parameter \tcode{result_last} or \tcode{result_r}; \item - $N$ be $\min(M + 1, \ \tcode{result_last - result})$. + $N$ be $\min(M, \ \tcode{result_last - result})$. \end{itemize} \pnum @@ -8006,9 +8009,9 @@ \pnum \effects -Copies only the first element from $N$ consecutive groups of equivalent elements -referred to by the iterator \tcode{i} in the range \range{first + 1}{last} -for which $E(\tcode{i})$ holds +Copies only the first $N$ elements +referred to by the iterator \tcode{i} in the range \range{first}{last} +for which $E(\tcode{i})$ is \tcode{true} into the range \range{result}{result + $N$}. \pnum @@ -8020,13 +8023,13 @@ \item \tcode{\{last, result + $N$\}} for the overloads in namespace \tcode{ranges}, - if $N$ is equal to $M + 1$. + if $N$ is equal to $M$. \item Otherwise, \tcode{\{j, result_last\}} for the overloads in namespace \tcode{ranges}, - where \tcode{j} is the iterator in \range{first + 1}{last} + where \tcode{j} is the iterator in \range{first}{last} for which $E(\tcode{j})$ is \tcode{false} - and there are exactly $N - 1$ iterators \tcode{i} in \range{first + 1}{j} + and there are exactly $N$ iterators \tcode{i} in \range{first}{j} for which $E(\tcode{i})$ is \tcode{false}. \end{itemize} diff --git a/source/exec.tex b/source/exec.tex index 6e99784a93..c68defc453 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -1364,6 +1364,18 @@ shall denote the same type. \end{itemize} +\pnum +\indexlibraryglobal{\tcode{\placeholder{unspecified-exception}}}% +Various function templates in subclause \ref{exec.snd} +can throw an exception of type \exposid{unspecified-exception}. +Each such exception object is of an unspecified type +such that a \grammarterm{handler} of type \tcode{exception} +matches\iref{except.handle} the exception object +but a handler of type \tcode{dependent_sender_error} does not. +\begin{note} +There is no requirement that two such exception objects have the same type. +\end{note} + \rSec2[exec.snd.expos]{Exposition-only entities} \pnum @@ -2068,8 +2080,6 @@ } }; \end{codeblock} -where \tcode{\placeholder{unspecified-exception}} is -a type derived from \tcode{exception}. \pnum \indexlibraryglobal{\exposid{decay-copyable-result-datums}} @@ -2082,8 +2092,6 @@ }); } \end{codeblock} -where \tcode{\placeholder{unspecified-exception}} is -a type derived from \tcode{exception}. \begin{itemdecl} template @@ -2986,7 +2994,8 @@ \pnum \throws -An exception of an unspecified type derived from \tcode{exception} if +An exception of type +\tcode{\placeholder{unspecified-exception}}\iref{exec.snd.general} if the expression \tcode{Q()(env)} is ill-formed or has type \tcode{void}, where \tcode{env} is an lvalue subexpression whose type is \tcode{Env}. \end{itemdescr} @@ -3822,8 +3831,6 @@ }; cs.@\exposid{for-each}@(@\exposid{overload-set}@{fn, [](auto){}}); \end{codeblock} -where \tcode{\placeholder{unspecified-exception}} is -a type derived from \tcode{exception}. \end{itemdescr} \pnum @@ -3972,8 +3979,6 @@ }; cs.@\exposid{for-each}@(@\exposid{overload-set}@(fn, [](auto){})); \end{codeblock} -where \tcode{\placeholder{unspecified-exception}} is -a type derived from \tcode{exception}, and where \tcode{\placeholder{is-valid-let-sender}} is \tcode{true} if and only if all of the following are \tcode{true}: \begin{itemize} @@ -4258,8 +4263,6 @@ }; cs.@\exposid{for-each}@(@\exposid{overload-set}@(fn, [](auto){})); \end{codeblock} -where \tcode{\placeholder{unspecified-exception}} is -a type derived from \tcode{exception}. \end{itemdescr} \pnum @@ -4475,14 +4478,13 @@ }; (fn.template operator()<@\exposid{child-type}@>(), ...); \end{codeblock} -where \tcode{\placeholder{unspecified-exception}} is -a type derived from \tcode{exception}. \pnum \throws Any exception thrown as a result of evaluating the \Fundescx{Effects}, or -an exception of an unspecified type -derived from \tcode{exception} when \tcode{CD} is ill-formed. +an exception of type +\tcode{\placeholder{unspecified-exception}}\iref{exec.snd.general} +when \tcode{CD} is ill-formed. \end{itemdescr} \pnum @@ -4820,8 +4822,6 @@ }; } \end{codeblock} -where \tcode{\placeholder{unspecified-exception}} is -a type derived from \tcode{exception}. \pnum Let \tcode{sndr} and \tcode{env} be subexpressions @@ -5340,8 +5340,10 @@ \pnum Let \tcode{\placeholder{ssource-t}} be an unspecified type -that models \exposconcept{stoppable-source} and -let \tcode{ssource} be an lvalue of type \tcode{\placeholder{ssource-t}}. +that models \exposconcept{stoppable-source} and \libconcept{default_initializable}, +such that a default-initialized object of type \tcode{\placeholder{ssource-t}} +has an associated stop state. +Let \tcode{ssource} be an lvalue of type \tcode{\placeholder{ssource-t}}. Let \tcode{\placeholder{stoken-t}} be \tcode{decltype(ssource.get_token())}. Let \exposid{future-spawned-sender} be the alias template: @@ -8529,8 +8531,13 @@ \pnum \returns -A non-null shared pointer to an object -that implements the \tcode{parallel_scheduler_backend} interface. +An object \tcode{p}, +such that \tcode{p.get()} points to a \tcode{parallel_scheduler_backend} object +that is a base-class subobject +of some most derived object \tcode{o} within its lifetime. +The lifetime of \tcode{o} does not end +as long as there exists a \tcode{shared_ptr} object \tcode{q} within its lifetime +such that \tcode{q.owner_equal(p)} is \tcode{true}. \pnum \remarks @@ -8562,12 +8569,12 @@ \pnum \expects The ends of -the lifetimes of \tcode{*this}, -the object referred to by \tcode{r}, and -any storage referenced by \tcode{s} +the lifetime of \tcode{*this}, +of the lifetime of the object referred to by \tcode{r}, and +of the duration of any storage referenced by \tcode{s} all happen after the beginning of the evaluation of -the call to \tcode{set_value}, \tcode{set_error}, or \tcode{set_done} +the call to \tcode{set_value}, \tcode{set_error}, or \tcode{set_stopped} on \tcode{r} (see below). \pnum @@ -8607,11 +8614,13 @@ \pnum \expects The ends of -the lifetimes of \tcode{*this}, -the object referred to by \tcode{r}, and -any storage referenced by \tcode{s} +the lifetime of \tcode{*this}, +of the lifetime of the object referred to by \tcode{r}, and +of the duration of any storage referenced by \tcode{s} all happen after -the beginning of the evaluation of one of the expressions below. +the beginning of the call to +\tcode{set_value}, \tcode{set_error}, or \tcode{set_stopped} +on \tcode{r} (see below). \pnum \effects @@ -8667,10 +8676,12 @@ \expects The ends of the lifetimes of \tcode{*this}, -the object referred to by \tcode{r}, and -any storage referenced by \tcode{s} +of the lifetime of the object referred to by \tcode{r}, and +of the duration of any storage referenced by \tcode{s} all happen after -the beginning of the evaluation of one of the expressions below. +the beginning of the evaluation of the call to +\tcode{set_value}, \tcode{set_error}, or \tcode{set_stopped} +on \tcode{r} (see below). \pnum \effects diff --git a/source/meta.tex b/source/meta.tex index f0bd37f53d..0b9e10b8d2 100644 --- a/source/meta.tex +++ b/source/meta.tex @@ -6182,7 +6182,8 @@ and the cv-unqualified types of \tcode{T} and \tcode{U} are the same, \item \tcode{U} is an array type, - \tcode{T} is a pointer type, and + \tcode{T} is a pointer type, + \tcode{remove_extent_t*} and \tcode{T} are similar types, and the value \tcode{r} represents is convertible to \tcode{T}, or \item \tcode{U} is a closure type, @@ -6881,6 +6882,41 @@ consteval info @\libglobal{unwrap_ref_decay}@(info type); \end{codeblock} +\pnum +For a function or function template $F$ defined in this subclause, +let $C$ be its associated class template. +For the evaluation of a call to $F$, +let $S$ be the specialization of $C$ in terms of which the call is specified. +\begin{itemize} +\item + If + \begin{itemize} + \item + the template arguments of $S$ violate a condition specified + in a \Fundescx{Mandates} element in the specification of $C$; + \item + the call is specified to produce a reflection of a type, + but $S$ would have no member named \tcode{type}; or + \item + the call is specified to return \tcode{S::value}, + but that expression is not a valid converted constant expression of type \tcode{R}, + where \tcode{R} is the return type of $F$; + \end{itemize} + then an exception of type \tcode{meta::exception} is thrown. + \begin{note} + For the first case, $S$ is not instantiated. + \end{note} + \item + Otherwise, if the instantiation of $S$ would result in undefined behavior + due to dependence on an incomplete type\iref{meta.rqmts}, + then the call is not a constant subexpression. + \item + Otherwise, if the template arguments of $S$ do not meet the preconditions of $C$, + then it is unspecified whether the call is a constant subexpression. + If it is, the call produces the result + that would be produced if $C$ had no preconditions. +\end{itemize} + \pnum Each function or function template declared above has the following behavior based on the signature and return type of that function or function template. @@ -6899,20 +6935,20 @@ \tcode{bool meta::\placeholder{UNARY}(info type);\br bool meta::\placeholder{UNARY}_type(info type);} & -\tcode{std::\placeholder{UNARY}_v<$T$>}, +\tcode{std::\placeholder{UNARY}<$T$>::value}, where $T$ is the type or type alias represented by \tcode{type} \\ \rowsep \tcode{bool meta::\placeholder{BINARY}(info t1, info t2);\br bool meta::\placeholder{BINARY}_type(info t1, info t2);} & -\tcode{std::\placeholder{BINARY}_v<$T_1$, $T_2$>}, +\tcode{std::\placeholder{BINARY}<$T_1$, $T_2$>::value}, where $T_1$ and $T_2$ are the types or type aliases represented by \tcode{t1} and \tcode{t2}, respectively \\ \rowsep \tcode{template\br bool meta::\placeholder{VARIADIC}_type(info type, R\&\& args);} & -\tcode{std::\placeholder{VARIADIC}_v<$T$, $U$...>}, +\tcode{std::\placeholder{VARIADIC}<$T$, $U$...>::value}, where $T$ is the type or type alias represented by \tcode{type} and \tcode{U...} is the pack of types or type aliases whose elements are represented by the corresponding elements of \tcode{args} @@ -6920,7 +6956,7 @@ \tcode{template\br bool meta::\placeholder{VARIADIC}_type(info t1, info t2, R\&\& args);} & -\tcode{std::\placeholder{VARIADIC}_v<$T_1$, $T_2$, $U$...>}, +\tcode{std::\placeholder{VARIADIC}<$T_1$, $T_2$, $U$...>::value}, where $T_1$ and $T_2$ are the types or type aliases represented by \tcode{t1} and \tcode{t2}, respectively, and \tcode{$U$...} is the pack of types or type aliases @@ -6929,14 +6965,14 @@ \tcode{info meta::\placeholder{UNARY}(info type);} & A reflection representing the type denoted by -\tcode{std::\placeholder{UNARY}_t<\brk{}$T$>}, +\tcode{std::\placeholder{UNARY}<\brk{}$T$>::type}, where $T$ is the type or type alias represented by \tcode{type} \\ \rowsep \tcode{template\br info meta::\placeholder{VARIADIC}(R\&\& args);} & A reflection representing the type denoted by -\tcode{std::\placeholder{VARIADIC}_t<$T$...>}, +\tcode{std::\placeholder{VARIADIC}<$T$...>::type}, where \tcode{$T$...} is the pack of types or type aliases whose elements are represented by the corresponding elements of \tcode{args} \\ \rowsep @@ -6944,7 +6980,7 @@ \tcode{template\br info meta::\placeholder{VARIADIC}(info type, R\&\& args);} & A reflection representing the type denoted by -\tcode{std::\placeholder{VARIADIC}_t<$T$, $U$...>}, +\tcode{std::\placeholder{VARIADIC}<$T$, $U$...>::type}, where \tcode{$T$} is the type or type alias represented by \tcode{type} and \tcode{$U$...} is the pack of types or type aliases whose elements are represented by the corresponding elements of \tcode{args} @@ -6974,7 +7010,7 @@ \begin{itemdescr} \pnum \returns -\tcode{rank_v<$T$>}, +\tcode{std::rank<$T$>::value}, where $T$ is the type represented by \tcode{dealias(type)}. \end{itemdescr} @@ -6986,7 +7022,7 @@ \begin{itemdescr} \pnum \returns -\tcode{extent_v<$T$, $I$>}, +\tcode{std::extent<$T$, $I$>::value}, where $T$ is the type represented by \tcode{dealias(type)} and $I$ is a constant equal to \tcode{i}. \end{itemdescr} @@ -6999,7 +7035,7 @@ \begin{itemdescr} \pnum \returns -\tcode{tuple_size_v<$T$>}, +\tcode{std::tuple_size<$T$>::value}, where $T$ is the type represented by \tcode{dealias(type)}. \end{itemdescr} @@ -7025,7 +7061,7 @@ \begin{itemdescr} \pnum \returns -\tcode{variant_size_v<$T$>}, +\tcode{std::variant_size<$T$>::value}, where $T$ is the type represented by \tcode{dealias(type)}. \end{itemdescr} @@ -7038,7 +7074,7 @@ \pnum \returns A reflection representing the type denoted by -\tcode{variant_alternative_t<$I$, $T$>}, +\tcode{std::variant_alternative<$I$, $T$>::type}, where $T$ is the type represented by \tcode{dealias(type)} and $I$ is a constant equal to \tcode{index}. \end{itemdescr} @@ -7051,7 +7087,7 @@ \begin{itemdescr} \pnum \returns -\tcode{type_order_v<$T_1$, $T_2$>}, +\tcode{std::type_order<$T_1$, $T_2$>::value}, where $T_1$ and $T_2$ are the types represented by \tcode{dealias(t1)} and \tcode{dealias(t2)}, respectively. \end{itemdescr}