diff --git a/source/algorithms.tex b/source/algorithms.tex index 5218902777..2879aff784 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -2355,7 +2355,8 @@ template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@ S, class Proj = identity, class T = projected_value_t> - requires @\libconcept{indirect_binary_predicate}@, const T*> + requires @\libconcept{permutable}@ && + @\libconcept{indirect_binary_predicate}@, const T*> subrange remove(Ep&& exec, I first, S last, const T& value, Proj proj = {}); // freestanding-deleted template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, class Proj = identity, @@ -2377,6 +2378,7 @@ template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@ S, class Proj = identity, @\libconcept{indirect_unary_predicate}@> Pred> + requires @\libconcept{permutable}@ subrange remove_if(Ep&& exec, I first, S last, Pred pred, Proj proj = {}); // freestanding-deleted template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, class Proj = identity, @@ -3217,6 +3219,7 @@ template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@ S, class Proj = identity, @\libconcept{indirect_unary_predicate}@> Pred> + requires @\libconcept{permutable}@ subrange partition(Ep&& exec, I first, S last, Pred pred, Proj proj = {}); // freestanding-deleted template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, class Proj = identity, @@ -7561,7 +7564,8 @@ template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@ S, class Proj = identity, class T = projected_value_t> - requires @\libconcept{indirect_binary_predicate}@, const T*> + requires @\libconcept{permutable}@ && + @\libconcept{indirect_binary_predicate}@, const T*> subrange ranges::remove(Ep&& exec, I first, S last, const T& value, Proj proj = {}); template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, class Proj = identity, @@ -7583,6 +7587,7 @@ template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@ S, class Proj = identity, @\libconcept{indirect_unary_predicate}@> Pred> + requires @\libconcept{permutable}@ subrange ranges::remove_if(Ep&& exec, I first, S last, Pred pred, Proj proj = {}); template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, class Proj = identity, @@ -7839,7 +7844,7 @@ \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 @@ -7943,10 +7948,10 @@ \begin{itemize} \setlength{\emergencystretch}{1em} \item - \tcode{bool(pred(*i, *(i - 1)))} + \tcode{bool(pred(*(i - 1), *i))} for the overloads in namespace \tcode{std}; \item - \tcode{bool(invoke(comp, invoke(proj, *i), invoke(proj, *(i - 1))))} + \tcode{bool(invoke(comp, invoke(proj, *(i - 1)), invoke(proj, *i)))} for the overloads in namespace \tcode{ranges}. \end{itemize} @@ -9696,6 +9701,7 @@ template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ I, @\libconcept{sized_sentinel_for}@ S, class Proj = identity, @\libconcept{indirect_unary_predicate}@> Pred> + requires @\libconcept{permutable}@ subrange ranges::partition(Ep&& exec, I first, S last, Pred pred, Proj proj = {}); template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, class Proj = identity, @\libconcept{indirect_unary_predicate}@, Proj>> Pred> @@ -13343,7 +13349,7 @@ \begin{itemdescr} \pnum \constraints -\tcode{T} is an arithmetic type other than \tcode{bool}. +\tcode{T} is an arithmetic type other than \cv{}~\tcode{bool}. \pnum \returns diff --git a/source/containers.tex b/source/containers.tex index 148d3de34e..000fe8cf93 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -6335,10 +6335,6 @@ In the case that \tcode{N == 0}, \tcode{begin() == end() ==} unique value. The return value of \tcode{data()} is unspecified. -\pnum -The effect of calling \tcode{front()} or \tcode{back()} for a zero-sized array is -undefined. - \pnum Member function \tcode{swap()} shall have a non-throwing exception specification. @@ -8975,7 +8971,7 @@ Equivalent to: \begin{codeblock} auto original_size = c.size(); -for (auto i = c.begin(), last = c.end(); i != last; ) { +for (auto i = c.begin(); i != c.end(); ) { if (pred(*i)) { i = c.erase(i); } else { @@ -11572,7 +11568,7 @@ const Allocator& = Allocator()); constexpr map(const map& x); constexpr map(map&& x); - explicit map(const Allocator&); + constexpr explicit map(const Allocator&); constexpr map(const map&, const type_identity_t&); constexpr map(map&&, const type_identity_t&); constexpr map(initializer_list, const Compare& = Compare(), @@ -13449,7 +13445,8 @@ is additional semantic information. \pnum -The types \tcode{iterator} and \tcode{const_iterator} meet +The types \tcode{iterator}, \tcode{const_iterator}, +\tcode{local_iterator}, and \tcode{const_local_iterator} meet the constexpr iterator requirements\iref{iterator.requirements.general}. \indexlibraryglobal{unordered_map}% @@ -14244,7 +14241,8 @@ there is additional semantic information. \pnum -The types \tcode{iterator} and \tcode{const_iterator} meet +The types \tcode{iterator}, \tcode{const_iterator}, +\tcode{local_iterator}, and \tcode{const_local_iterator} meet the constexpr iterator requirements\iref{iterator.requirements.general}. \indexlibraryglobal{unordered_multimap}% @@ -14734,7 +14732,8 @@ is additional semantic information. \pnum -The types \tcode{iterator} and \tcode{const_iterator} meet +The types \tcode{iterator}, \tcode{const_iterator}, +\tcode{local_iterator}, and \tcode{const_local_iterator} meet the constexpr iterator requirements\iref{iterator.requirements.general}. \indexlibraryglobal{unordered_set}% @@ -15154,7 +15153,8 @@ is additional semantic information. \pnum -The types \tcode{iterator} and \tcode{const_iterator} meet +The types \tcode{iterator}, \tcode{const_iterator}, +\tcode{local_iterator}, and \tcode{const_local_iterator} meet the constexpr iterator requirements\iref{iterator.requirements.general}. \indexlibraryglobal{unordered_multiset}% @@ -15627,6 +15627,9 @@ template Container> struct formatter, charT>; + template + constexpr bool enable_nonlocking_formatter_optimization> = false; + // \ref{priority.queue}, class template \tcode{priority_queue} template, class Compare = less> @@ -15641,6 +15644,10 @@ // \ref{container.adaptors.format}, formatter specialization for \tcode{priority_queue} template Container, class Compare> struct formatter, charT>; + + template + constexpr bool + enable_nonlocking_formatter_optimization> = false; } \end{codeblock} @@ -16552,6 +16559,9 @@ // \ref{container.adaptors.format}, formatter specialization for \tcode{stack} template Container> struct formatter, charT>; + + template + constexpr bool enable_nonlocking_formatter_optimization> = false; } \end{codeblock} @@ -19040,7 +19050,7 @@ constexpr container_type extract() &&; constexpr void replace(container_type&&); - constexpr iterator erase(iterator position); + constexpr iterator erase(iterator position) requires (!@\libconcept{same_as}@); constexpr iterator erase(const_iterator position); constexpr size_type erase(const key_type& x); template constexpr size_type erase(K&& x); @@ -19711,7 +19721,7 @@ constexpr container_type extract() &&; constexpr void replace(container_type&&); - constexpr iterator erase(iterator position); + constexpr iterator erase(iterator position) requires (!@\libconcept{same_as}@); constexpr iterator erase(const_iterator position); constexpr size_type erase(const key_type& x); template constexpr size_type erase(K&& x); @@ -20160,6 +20170,10 @@ The header \libheaderref{mdspan} defines the class template \tcode{mdspan} and other facilities for interacting with these multidimensional views. +\pnum +In addition to being available via inclusion of the \libheaderref{span} header, +\tcode{dynamic_extent} is available when the header \libheaderref{mdspan} is included. + \rSec2[views.contiguous]{Contiguous access} \rSec3[span.syn]{Header \tcode{} synopsis}% @@ -20176,7 +20190,7 @@ template concept @\defexposconcept{integral-constant-like}@ = // \expos is_integral_v> && - !is_same_v> && + !is_same_v> && @\libconcept{convertible_to}@ && @\libconcept{equality_comparable_with}@ && bool_constant::value && @@ -20643,7 +20657,7 @@ \pnum \effects -Equivalent to: \tcode{return R\{data(), Count\};} +Equivalent to: \tcode{return R(data(), Count);} where \tcode{R} is the return type. \end{itemdescr} @@ -20663,7 +20677,7 @@ \pnum \effects -Equivalent to: \tcode{return R\{data() + (size() - Count), Count\};} +Equivalent to: \tcode{return R(data() + (size() - Count), Count);} where \tcode{R} is the return type. \end{itemdescr} @@ -20718,7 +20732,8 @@ \pnum \effects -Equivalent to: \tcode{return \{data(), count\};} +Equivalent to: \tcode{return R(data(), count);} +where \tcode{R} is the return type. \end{itemdescr} \indexlibrarymember{span}{last}% @@ -20733,7 +20748,8 @@ \pnum \effects -Equivalent to: \tcode{return \{data() + (size() - count), count\};} +Equivalent to: \tcode{return R(data() + (size() - count), count);} +where \tcode{R} is the return type. \end{itemdescr} \indexlibrarymember{span}{subspan}% @@ -20754,8 +20770,9 @@ \effects Equivalent to: \begin{codeblock} -return {data() + offset, count == dynamic_extent ? size() - offset : count}; +return R(data() + offset, count == dynamic_extent ? size() - offset : count); \end{codeblock} +where \tcode{R} is the return type. \end{itemdescr} \rSec4[span.obs]{Observers} @@ -20958,6 +20975,10 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\constraints +\tcode{is_volatile_v} is \tcode{false}. + \pnum \effects Equivalent to: \tcode{return R\{reinterpret_cast(s.data()), s.size_bytes()\};} @@ -20974,7 +20995,8 @@ \begin{itemdescr} \pnum \constraints -\tcode{is_const_v} is \tcode{false}. +\tcode{is_const_v} is \tcode{false} and +\tcode{is_volatile_v} is \tcode{false}. \pnum \effects @@ -21245,7 +21267,7 @@ \effects \begin{itemize} \item -If \tcode{OtherIndexType} is an integral type other than \tcode{bool}, +If \tcode{remove_cvref_t} is an integral type other than \tcode{bool}, then equivalent to \tcode{return i;}, \item otherwise, equivalent to \tcode{return static_cast(i);}. @@ -22599,7 +22621,7 @@ constexpr index_type operator()(Indices...) const noexcept; static constexpr bool is_always_unique() noexcept { return true; } - static constexpr bool is_always_exhaustive() noexcept { return false; } + static constexpr bool is_always_exhaustive(); static constexpr bool is_always_strided() noexcept { return true; } static constexpr bool is_unique() noexcept { return true; } @@ -22882,6 +22904,20 @@ \end{codeblock} \end{itemdescr} +\indexlibrarymember{is_always_exhaustive}{layout_stride::mapping}% +\begin{itemdecl} +static constexpr bool is_always_exhaustive() noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\returns +\tcode{true} if \exposid{rank_} is \tcode{0} +or if there is a rank index \tcode{r} of \tcode{extents()} +such that \tcode{extents_type::static_extent(r)} is \tcode{0}, +otherwise \tcode{false}. +\end{itemdescr} + \indexlibrarymember{is_exhaustive}{layout_stride::mapping}% \begin{itemdecl} constexpr bool is_exhaustive() const noexcept; @@ -22892,7 +22928,8 @@ \returns \begin{itemize} \item -\tcode{true} if \exposid{rank_} is 0. +\tcode{true} if \exposid{rank_} or the size of the multidimensional index space +\tcode{m.extents()} is 0. \item Otherwise, \tcode{true} if there is a permutation $P$ of the integers in the range $[0, \exposid{rank_})$ @@ -23057,6 +23094,7 @@ then the size of the multidimensional index space \tcode{Extents()} is representable as a value of type \tcode{index_type}. \item +If \tcode{padding_value} is not equal to \tcode{dynamic_extent}, then \tcode{padding_value} is representable as a value of type \tcode{index_type}. \item If @@ -23683,6 +23721,7 @@ then the size of the multidimensional index space \tcode{Extents()} is representable as a value of type \tcode{index_type}. \item +If \tcode{padding_value} is not equal to \tcode{dynamic_extent}, then \tcode{padding_value} is representable as a value of type \tcode{index_type}. \item If diff --git a/source/exec.tex b/source/exec.tex index 6e99784a93..11b43f5847 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -1157,10 +1157,6 @@ A scheduler type's destructor shall not block pending completion of any receivers connected to the sender objects returned from \tcode{schedule}. -\begin{note} -The ability to wait for completion of submitted function objects -can be provided by the associated execution resource of the scheduler. -\end{note} \rSec1[exec.recv]{Receivers} @@ -7098,7 +7094,7 @@ using sender_concept = sender_t; template<@\libconcept{receiver}@ Rcvr> - @\exposid{state}@ connect(Rcvr&& rcvr); + @\exposid{state}@ connect(Rcvr&& rcvr) &&; }; } \end{codeblock} @@ -7125,7 +7121,7 @@ \indexlibrarymember{connect}{task_scheduler::\exposid{ts-sender}}% \begin{itemdecl} template<@\libconcept{receiver}@ Rcvr> - @\exposid{state}@ connect(Rcvr&& rcvr); + @\exposid{state}@ connect(Rcvr&& rcvr) &&; \end{itemdecl} \begin{itemdescr} \pnum @@ -7183,7 +7179,7 @@ \begin{codeblock} namespace std::execution { - template + template> class @\libglobal{task}@ { // \ref{task.state} template<@\libconcept{receiver}@ Rcvr> @@ -7205,7 +7201,7 @@ ~task(); template<@\libconcept{receiver}@ Rcvr> - @\exposid{state}@ connect(Rcvr&& rcvr); + @\exposid{state}@ connect(Rcvr&& rcvr) &&; private: coroutine_handle @\exposidnc{handle}@; // \expos @@ -7292,7 +7288,7 @@ \indexlibrarymember{connect}{task}% \begin{itemdecl} template<@\libconcept{receiver}@ Rcvr> - @\exposid{state}@ connect(Rcvr&& recv); + @\exposid{state}@ connect(Rcvr&& recv) &&; \end{itemdecl} \begin{itemdescr} \pnum @@ -7427,14 +7423,14 @@ task get_return_object() noexcept; - auto initial_suspend() noexcept; + static constexpr suspend_always @\libmember{initial_suspend}{task::promise_type}@() noexcept { return {}; } auto final_suspend() noexcept; - void uncaught_exception(); - coroutine_handle<> unhandled_stopped(); + void unhandled_exception(); + coroutine_handle<> unhandled_stopped() noexcept; void return_void(); // present only if \tcode{is_void_v} is \tcode{true} - template + template void return_value(V&& value); // present only if \tcode{is_void_v} is \tcode{false} template @@ -7513,22 +7509,6 @@ \tcode{coroutine_handle::\brk{}from_promise\brk{}(*this)}. \end{itemdescr} -\indexlibrarymember{initial_suspend}{task::promise_type}% -\begin{itemdecl} -auto initial_suspend() noexcept; -\end{itemdecl} -\begin{itemdescr} -\pnum -\returns -An awaitable object of unspecified type\iref{expr.await} whose -member functions arrange for -\begin{itemize} -\item the calling coroutine to be suspended, -\item the coroutine to be resumed on an execution agent of the -execution resource associated with \tcode{\exposid{SCHED}(*this)}. -\end{itemize} -\end{itemdescr} - \indexlibrarymember{final_suspend}{task::promise_type}% \begin{itemdecl} auto final_suspend() noexcept; @@ -7601,9 +7581,9 @@ \end{codeblock} \end{itemdescr} -\indexlibrarymember{uncaught_exception}{task::promise_type}% +\indexlibrarymember{unhandled_exception}{task::promise_type}% \begin{itemdecl} -void uncaught_exception(); +void unhandled_exception(); \end{itemdecl} \begin{itemdescr} \pnum @@ -7615,7 +7595,7 @@ \indexlibrarymember{unhandled_stopped}{task::promise_type}% \begin{itemdecl} -coroutine_handle<> unhandled_stopped(); +coroutine_handle<> unhandled_stopped() noexcept; \end{itemdecl} \begin{itemdescr} \pnum @@ -7629,6 +7609,26 @@ \tcode{noop_coroutine()}. \end{itemdescr} +\indexlibrarymember{return_void}{task::promise_type}% +\begin{itemdecl} +void return_void(); +\end{itemdecl} +\begin{itemdescr} +\pnum +\effects +Does nothing. +\end{itemdescr} + +\indexlibrarymember{return_value}{task::promise_type}% +\begin{itemdecl} +void return_value(V&& v); +\end{itemdecl} +\begin{itemdescr} +\pnum +\effects +Equivalent to \tcode{\exposid{result}.emplace(std::forward(v))}. +\end{itemdescr} + \indexlibrarymember{get_env}{task::promise_type}% \begin{itemdecl} @\unspec@ get_env() const noexcept; diff --git a/source/iterators.tex b/source/iterators.tex index 9914bd249f..fcb7fc986f 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -4246,6 +4246,7 @@ @\exposid{iter-const-rvalue-reference-t}@; public: + using iterator_type = Iterator; using iterator_concept = @\seebelow@; using iterator_category = @\seebelow@; // not always present using value_type = iter_value_t; diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 2958545e4a..f484e28445 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1914,7 +1914,7 @@ {p{1in}p{4.15in}} \topline \hdstyle{Expression} & \hdstyle{Post-condition} \\ \capsep -\tcode{a.\~T()} & All resources owned by \tcode{a} are reclaimed, no exception is propagated. \\ \rowsep +\tcode{a.\~T()} & No exception is propagated. \\ \rowsep \multicolumn{2}{|l|}{ \begin{tailnote} Array types and non-object types are not \oldconcept{Destructible}. diff --git a/source/memory.tex b/source/memory.tex index 1b455e868b..a5a8d28722 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -85,7 +85,7 @@ template constexpr T* assume_aligned(T* ptr); // freestanding template - bool is_sufficiently_aligned(T* ptr); + bool is_sufficiently_aligned(T* ptr); // freestanding // \ref{obj.lifetime}, explicit lifetime management template @@ -1326,7 +1326,7 @@ then \tcode{alloc} is ignored. \item Otherwise, if \tcode{T} has a constructor invocable as - \tcode{T(allocator_arg, alloc, args...)} (leading-allocator convention), + \tcode{T(allocator_arg_t\{\}, alloc, args...)} (leading-allocator convention), then uses-allocator construction chooses this constructor form. \item Otherwise, if \tcode{T} has a constructor invocable as diff --git a/source/meta.tex b/source/meta.tex index f0bd37f53d..340e077d97 100644 --- a/source/meta.tex +++ b/source/meta.tex @@ -2910,6 +2910,7 @@ \indexheader{meta}% \begin{codeblock} +#include // see \ref{compare.syn} #include // see \ref{initializer.list.syn} namespace std { @@ -3400,8 +3401,8 @@ \pnum Let $V$ be the pack of values of type \tcode{CharT} whose elements are the corresponding elements of \tcode{r}, -except that if \tcode{r} refers to a string literal object, -then $V$ does not include the trailing null terminator of \tcode{r}. +except that if \tcode{r} is a reference to a string literal object, +then $V$ does not include the terminating \unicode{0000}{null} character of \tcode{r}. \pnum Let $P$ be the template parameter object\iref{temp.param} @@ -5110,8 +5111,8 @@ \rSec2[meta.reflection.access.context]{Access control context} \pnum -The \tcode{access_context} class is a non-aggregate type -that represents a namespace, class, or function +The class \tcode{access_context} +represents a namespace, class, or function from which queries pertaining to access rules may be performed, as well as the designating class\iref{class.access.base}, if any. @@ -5137,7 +5138,7 @@ \end{codeblock} \pnum -\tcode{access_context} is a structural type. +\tcode{access_context} is a structural, consteval-only, non-aggregate type. Two values \tcode{ac1} and \tcode{ac2} of type \tcode{access_context} are template-argument-equivalent\iref{temp.type} if \tcode{ac1.scope()} and \tcode{ac2.scope()} @@ -6578,7 +6579,9 @@ \item \tcode{options.alignment} does not contain a value, \item - \tcode{options.no_unique_address} is \tcode{false}, and + \tcode{options.no_unique_address} is \tcode{false}, + \item + $V$ is not negative, and \item if $V$ equals \tcode{0}, then \tcode{options.name} does not contain a value; and diff --git a/source/numerics.tex b/source/numerics.tex index 9d6bf6e62c..3706084e17 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -11698,6 +11698,9 @@ \tcode{t} applies to accesses done through the parameter preceding \tcode{t} in the parameter list of \tcode{F}. Let \tcode{m} be such an access-modified function parameter. \tcode{F} will only access the triangle of \tcode{m} specified by \tcode{t}. +For accesses of diagonal elements \tcode{m[i, i]}, +\tcode{F} will use the value \tcode{\exposid{real-if-needed}(m[i, i])} +if the name of \tcode{F} starts with \tcode{hermitian}. For accesses \tcode{m[i, j]} outside the triangle specified by \tcode{t}, \tcode{F} will use the value \begin{itemize} @@ -13803,6 +13806,8 @@ \pnum \mandates +\tcode{InVec::value_type} and \tcode{Scalar} are either a floating-point type, or +a specialization of \tcode{complex}. Let \tcode{a} be \tcode{\exposid{abs-if-needed}(declval())}. Then, \tcode{decltype(\linebreak init + a * a} is convertible to \tcode{Scalar}. @@ -13817,9 +13822,7 @@ \pnum \remarks -If \tcode{InVec::value_type}, and \tcode{Scalar} -are all floating-point types or specializations of \tcode{complex}, -and if \tcode{Scalar} has higher precision +If \tcode{Scalar} has higher precision than \tcode{InVec::value_type}, then intermediate terms in the sum use \tcode{Scalar}'s precision or greater. \begin{note} @@ -14009,6 +14012,8 @@ \pnum \mandates +\tcode{InVec::value_type} and \tcode{Scalar} are either a floating-point type, or +a specialization of \tcode{complex}. Let \tcode{a} be \tcode{\exposid{abs-if-needed}(declval())}. Then, \tcode{decltype(\linebreak init + a * a)} @@ -14025,9 +14030,7 @@ \pnum \remarks -If \tcode{InMat::value_type} and \tcode{Scalar} -are all floating-point types or specializations of \tcode{complex}, -and if \tcode{Scalar} has higher precision +If \tcode{Scalar} has higher precision than \tcode{InMat::value_type}, then intermediate terms in the sum use \tcode{Scalar}'s precision or greater. \end{itemdescr} @@ -14233,7 +14236,7 @@ \tcode{\exposid{possibly-multipliable}()} is \tcode{true}, and \item -\tcode{\exposid{possibly-addable}()} +\tcode{\exposid{possibly-addable}()} is \tcode{true} for those overloads that take a \tcode{z} parameter. \end{itemize} @@ -14243,12 +14246,12 @@ \item \tcode{\exposid{multipliable}(A,x,y)} is \tcode{true}, and \item -\tcode{\exposid{addable}(x,y,z)} is \tcode{true} for those overloads that take a \tcode{z} parameter. +\tcode{\exposid{addable}(y,y,z)} is \tcode{true} for those overloads that take a \tcode{z} parameter. \end{itemize} \pnum \complexity -\bigoh{\tcode{x.extent(0)} \times \tcode{A.extent(1)}}. +\bigoh{\tcode{A.extent(0)} \times \tcode{x.extent(0)}}. \indexlibraryglobal{matrix_vector_product}% \begin{itemdecl} @@ -14343,7 +14346,7 @@ \tcode{\exposid{possibly-multipliable}()} is \tcode{true}; and \item -\tcode{\exposid{possibly-addable}()} +\tcode{\exposid{possibly-addable}()} is \tcode{true} for those overloads that take a \tcode{z} parameter. \end{itemize} @@ -14355,13 +14358,13 @@ \item \tcode{\exposid{multipliable}(A,x,y)} is \tcode{true}, and \item -\tcode{\exposid{addable}(x,y,z)} is \tcode{true} +\tcode{\exposid{addable}(y,y,z)} is \tcode{true} for those overloads that take a \tcode{z} parameter. \end{itemize} \pnum \complexity -\bigoh{\tcode{x.extent(0)} \times \tcode{A.extent(1)}}. +\bigoh{\tcode{A.extent(0)} \times \tcode{x.extent(0)}}. \indexlibraryglobal{symmetric_matrix_vector_product}% \begin{itemdecl} @@ -14435,7 +14438,7 @@ \tcode{\exposid{possibly-multipliable}()} is \tcode{true}; and \item -\tcode{\exposid{possibly-addable}()} +\tcode{\exposid{possibly-addable}()} is \tcode{true} for those overloads that take a \tcode{z} parameter. \end{itemize} @@ -14447,12 +14450,12 @@ \item \tcode{\exposid{multipliable}(A, x, y)} is \tcode{true}, and \item -\tcode{\exposid{addable}(x, y, z)} is \tcode{true} for those overloads that take a \tcode{z} parameter. +\tcode{\exposid{addable}(y, y, z)} is \tcode{true} for those overloads that take a \tcode{z} parameter. \end{itemize} \pnum \complexity -\bigoh{\tcode{x.extent(0)} \times \tcode{A.extent(1)}}. +\bigoh{\tcode{A.extent(0)} \times \tcode{x.extent(0)}}. \indexlibraryglobal{hermitian_matrix_vector_product}% \begin{itemdecl} @@ -14571,7 +14574,7 @@ \pnum \complexity -\bigoh{\tcode{x.extent(0)} \times \tcode{A.extent(1)}}. +\bigoh{\tcode{A.extent(0)} \times \tcode{x.extent(0)}}. \end{itemdescr} \indexlibraryglobal{triangular_matrix_vector_product}% @@ -14603,7 +14606,7 @@ \pnum \complexity -\bigoh{\tcode{y.extent(0)} \times \tcode{A.extent(1)}}. +\bigoh{\tcode{A.extent(0)} \times \tcode{y.extent(0)}}. \end{itemdescr} \indexlibraryglobal{triangular_matrix_vector_product}% @@ -14631,7 +14634,7 @@ \pnum \complexity -\bigoh{\tcode{x.extent(0)} \times \tcode{A.extent(1)}}. +\bigoh{\tcode{A.extent(0)} \times \tcode{x.extent(0)}}. \pnum \remarks @@ -15560,32 +15563,19 @@ \item If \tcode{InOutMat} has \tcode{layout_blas_packed} layout, then the layout's \tcode{Triangle} template argument has -the same type as the function's \tcode{Triangle} template argument; -\item -\tcode{\exposid{compatible-static-extents}(0, 1)} -is \tcode{true}; -\item -\tcode{\exposid{compatible-static-extents}(0, 1)} -is \tcode{true}; and +the same type as the function's \tcode{Triangle} template argument; and \item -\tcode{\exposid{compatible-static-extents}(0, 0)} +\tcode{\exposid{possibly-multipliable}()} is \tcode{true}. \end{itemize} \pnum \expects -\begin{itemize} -\item -\tcode{A.extent(0)} equals \tcode{A.extent(1)}, -\item -\tcode{C.extent(0)} equals \tcode{C.extent(1)}, and -\item -\tcode{A.extent(0)} equals \tcode{C.extent(0)}. -\end{itemize} +\tcode{\exposid{multipliable}(A, transposed(A), C)} is \tcode{true}. \pnum \complexity -\bigoh{\tcode{A.extent(0)} \times \tcode{A.extent(1)} \times \tcode{C.extent(0)}}. +\bigoh{\tcode{A.extent(0)} \times \tcode{A.extent(1)} \times \tcode{A.extent(0)}}. \indexlibraryglobal{symmetric_matrix_rank_k_update}% \begin{itemdecl} @@ -15676,10 +15666,10 @@ then the layout's \tcode{Triangle} template argument has the same type as the function's \tcode{Triangle} template argument; \item -\tcode{\exposid{possibly-addable}()} +\tcode{\exposid{possibly-multipliable}()} is \tcode{true}; and \item -\tcode{\exposid{compatible-static-extents}(0, 1)} +\tcode{\exposid{possibly-multipliable}()} is \tcode{true}. \end{itemize} @@ -15687,14 +15677,16 @@ \expects \begin{itemize} \item -\tcode{\exposid{addable}(A, B, C)} is \tcode{true}, and +\tcode{\exposid{multipliable}(A, transposed(B), C)} +is \tcode{true}, and \item -\tcode{A.extent(0)} equals \tcode{A.extent(1)}. +\tcode{\exposid{multipliable}(B, transposed(A), C)} +is \tcode{true}. \end{itemize} \pnum \complexity -\bigoh{\tcode{A.extent(0)} \times \tcode{A.extent(1)} \times \tcode{C.extent(0)}}. +\bigoh{\tcode{A.extent(0)} \times \tcode{A.extent(1)} \times \tcode{B.extent(0)}}. \indexlibraryglobal{symmetric_matrix_rank_2k_update}% \begin{itemdecl} @@ -15793,7 +15785,7 @@ \pnum \complexity -\bigoh{\tcode{A.extent(0)} \times \tcode{X.extent(1)} \times \tcode{X.extent(1)}}. +\bigoh{\tcode{A.extent(0)} \times \tcode{B.extent(1)} \times \tcode{B.extent(1)}}. \end{itemdescr} \pnum @@ -16007,7 +15999,7 @@ \pnum \complexity -\bigoh{\tcode{A.extent(0)} \times \tcode{A.extent(1)} \times \tcode{B.extent(1)}}. +\bigoh{\tcode{B.extent(0)} \times \tcode{A.extent(0)} \times \tcode{A.extent(1)}}. \end{itemdescr} \indexlibraryglobal{triangular_matrix_matrix_left_solve}% @@ -16633,8 +16625,8 @@ const typename basic_vec::mask_type& mask, flags f = {}); // \ref{simd.permute.static}, static permute - static constexpr @\exposid{simd-size-type}@ @\libmember{zero_element}{simd}@ = @\impdefx{value of \tcode{simd::zero_element}}@; - static constexpr @\exposid{simd-size-type}@ @\libmember{uninit_element}{simd}@ = @\impdefx{value of \tcode{simd::uninit_element}}@; + inline constexpr @\exposid{simd-size-type}@ @\libmember{zero_element}{simd}@ = @\impdefx{value of \tcode{simd::zero_element}}@; + inline constexpr @\exposid{simd-size-type}@ @\libmember{uninit_element}{simd}@ = @\impdefx{value of \tcode{simd::uninit_element}}@; template<@\exposid{simd-size-type}@ N = @\seebelow@, @\exposconcept{simd-vec-type}@ V, class IdxMap> constexpr resize_t permute(const V& v, IdxMap&& idxmap); @@ -16911,7 +16903,7 @@ // \ref{simd.bit}, bit manipulation template<@\exposconcept{simd-vec-type}@ V> constexpr V byteswap(const V& v) noexcept; - template<@\exposconcept{simd-vec-type}@ V> constexpr V bit_ceil(const V& v) noexcept; + template<@\exposconcept{simd-vec-type}@ V> constexpr V bit_ceil(const V& v); template<@\exposconcept{simd-vec-type}@ V> constexpr V bit_floor(const V& v) noexcept; template<@\exposconcept{simd-vec-type}@ V> @@ -17148,14 +17140,8 @@ \begin{itemdescr} \pnum \tcode{alignment} has a member \tcode{value} if and only if -\begin{itemize} - \item - \tcode{T} is a specialization of \tcode{basic_mask} and \tcode{U} is - \tcode{bool}, or - \item - \tcode{T} is a specialization of \tcode{basic_vec} and \tcode{U} is a - vectorizable type. -\end{itemize} +\tcode{T} is a specialization of \tcode{basic_vec} and +\tcode{U} is a vectorizable type. \pnum If \tcode{value} is present, the type \tcode{alignment} is a @@ -17724,7 +17710,7 @@ \tcode{value_type} is value-preserving\iref{simd.general}, or \item \tcode{From} satisfies \exposconcept{constexpr-wrapper-like}, - \tcode{remove_const_t} is an arithmetic type, and + \tcode{remove_cvref_t} is an arithmetic type, and \tcode{From::value} is representable by \tcode{value_type}. \end{itemize} \end{itemdescr} @@ -17863,7 +17849,7 @@ \pnum \remarks The deduced type is equivalent to \tcode{vec, -ranges::size(r)>}. +static_cast<\exposid{simd-size-type}>(ranges::size(r))>}. \end{itemdescr} \indexlibraryctor{basic_vec} @@ -18598,11 +18584,12 @@ \end{itemize} \pnum -\effects -Initializes the $i^\text{th}$ element with\\ +\returns +A \tcode{basic_vec} object whose $i^\text{th}$ element is initialized with \tcode{mask[$i$] \&\& $i$ < ranges::size(r) ? static_cast(\brk{}ranges::data(r)[$i$]) : T()} for all $i$ in the range of -\range{0}{V::size()}. +\range{0}{V::size()}, +where \tcode{T} is \tcode{V::value_type}. \pnum \remarks @@ -19769,7 +19756,7 @@ \indexlibrarymember{bit_ceil}{simd} \begin{itemdecl} -template<@\exposconcept{simd-vec-type}@ V> constexpr V bit_ceil(const V& v) noexcept; +template<@\exposconcept{simd-vec-type}@ V> constexpr V bit_ceil(const V& v); \end{itemdecl} \begin{itemdescr} @@ -20043,8 +20030,11 @@ constexpr explicit basic_mask(const basic_mask&) noexcept; template constexpr explicit basic_mask(G&& gen); - constexpr basic_mask(const bitset& b) noexcept; - constexpr explicit basic_mask(@\libconcept{unsigned_integral}@ auto val) noexcept; + template<@\libconcept{same_as}@> T> + constexpr basic_mask(const T& b) noexcept; + template<@\libconcept{unsigned_integral}@ T> + requires (!@\libconcept{same_as}@) + constexpr explicit basic_mask(T val) noexcept; // \ref{simd.mask.subscr}, \tcode{basic_mask} subscript operators constexpr value_type operator[](@\exposid{simd-size-type}@) const; @@ -20148,7 +20138,7 @@ \indexlibraryctor{basic_mask} \begin{itemdecl} -constexpr explicit basic_mask(value_type x) noexcept; +constexpr explicit basic_mask(@\libconcept{same_as}@ auto) noexcept; \end{itemdecl} \begin{itemdescr} @@ -20200,7 +20190,8 @@ \indexlibraryctor{basic_mask} \begin{itemdecl} -constexpr basic_mask(const bitset& b) noexcept; +template<@\libconcept{same_as}@> T> + constexpr basic_mask(const T& b) noexcept; \end{itemdecl} \begin{itemdescr} @@ -20212,7 +20203,9 @@ \indexlibraryctor{basic_mask} \begin{itemdecl} -constexpr explicit basic_mask(@\libconcept{unsigned_integral}@ auto val) noexcept; +template<@\libconcept{unsigned_integral}@ T> + requires (!@\libconcept{same_as}@) + constexpr explicit basic_mask(T val) noexcept; \end{itemdecl} \begin{itemdescr} diff --git a/source/ranges.tex b/source/ranges.tex index ce5fa670c0..3bf0febc8d 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -8921,7 +8921,8 @@ Equivalent to: \begin{codeblock} constexpr auto N = sizeof...(Views); -if constexpr (@\libconcept{common_range}@<@\exposid{maybe-const}@<@\exposid{is-const}@, Views...[N - 1]>>) { +if constexpr (@\exposconcept{all-forward}<\exposid{is-const}, Views...>@ && + @\libconcept{common_range}@<@\exposid{maybe-const}@<@\exposid{is-const}@, Views...[N - 1]>>) { return @\exposid{iterator}@<@\exposid{is-const}@>(this, in_place_index, ranges::end(std::get(@\exposid{views_}@))); } else { diff --git a/source/support.tex b/source/support.tex index c6929d58ff..125e9c8a13 100644 --- a/source/support.tex +++ b/source/support.tex @@ -572,14 +572,14 @@ // also in \libheader{algorithm}, \libheader{ranges}, \libheader{string}, \libheader{deque}, \libheader{list}, \libheader{forward_list}, \libheader{vector} #define @\defnlibxname{cpp_lib_algorithm_iterator_requirements}@ 202207L // also in \libheader{algorithm}, \libheader{numeric}, \libheader{memory} -#define @\defnlibxname{cpp_lib_aligned_accessor}@ 202411L // also in \libheader{mdspan} +#define @\defnlibxname{cpp_lib_aligned_accessor}@ 202411L // freestanding, also in \libheader{mdspan} #define @\defnlibxname{cpp_lib_allocate_at_least}@ 202302L // also in \libheader{memory} #define @\defnlibxname{cpp_lib_allocator_traits_is_always_equal}@ 201411L // freestanding, also in \libheader{memory}, \libheader{scoped_allocator}, \libheader{string}, \libheader{deque}, \libheader{forward_list}, \libheader{list}, // \libheader{vector}, \libheader{map}, \libheader{set}, \libheader{unordered_map}, \libheader{unordered_set} #define @\defnlibxname{cpp_lib_any}@ 201606L // also in \libheader{any} #define @\defnlibxname{cpp_lib_apply}@ 202506L // freestanding, also in \libheader{tuple}, \libheader{type_traits} -#define @\defnlibxname{cpp_lib_array_constexpr}@ 201811L // also in \libheader{iterator}, \libheader{array} +#define @\defnlibxname{cpp_lib_array_constexpr}@ 201811L // freestanding, also in \libheader{iterator}, \libheader{array} #define @\defnlibxname{cpp_lib_as_const}@ 201510L // freestanding, also in \libheader{utility} #define @\defnlibxname{cpp_lib_associative_heterogeneous_erasure}@ 202110L // also in \libheader{map}, \libheader{set}, \libheader{unordered_map}, \libheader{unordered_set} @@ -612,7 +612,7 @@ // \libheader{string_view} #define @\defnlibxname{cpp_lib_chrono}@ 202306L // also in \libheader{chrono} #define @\defnlibxname{cpp_lib_chrono_udls}@ 201304L // also in \libheader{chrono} -#define @\defnlibxname{cpp_lib_clamp}@ 201603L // also in \libheader{algorithm} +#define @\defnlibxname{cpp_lib_clamp}@ 201603L // freestanding, also in \libheader{algorithm} #define @\defnlibxname{cpp_lib_common_reference}@ 202302L // freestanding, also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_common_reference_wrapper}@ 202302L // freestanding, also in \libheader{functional} #define @\defnlibxname{cpp_lib_complex_udls}@ 201309L // also in \libheader{complex} @@ -639,7 +639,7 @@ #define @\defnlibxname{cpp_lib_constexpr_map}@ 202502L // also in \libheader{map} #define @\defnlibxname{cpp_lib_constexpr_memory}@ 202506L // freestanding, also in \libheader{memory} #define @\defnlibxname{cpp_lib_constexpr_new}@ 202406L // freestanding, also in \libheader{new} -#define @\defnlibxname{cpp_lib_constexpr_numeric}@ 201911L // also in \libheader{numeric} +#define @\defnlibxname{cpp_lib_constexpr_numeric}@ 201911L // freestanding, also in \libheader{numeric} #define @\defnlibxname{cpp_lib_constexpr_queue}@ 202502L // also in \libheader{queue} #define @\defnlibxname{cpp_lib_constexpr_set}@ 202502L // also in \libheader{set} #define @\defnlibxname{cpp_lib_constexpr_stack}@ 202502L // also in \libheader{stack} @@ -708,8 +708,8 @@ #define @\defnlibxname{cpp_lib_freestanding_utility}@ 202306L // freestanding, also in \libheader{utility} #define @\defnlibxname{cpp_lib_freestanding_variant}@ 202311L // freestanding, also in \libheader{variant} #define @\defnlibxname{cpp_lib_fstream_native_handle}@ 202306L // also in \libheader{fstream} -#define @\defnlibxname{cpp_lib_function_ref}@ 202306L // also in \libheader{functional} -#define @\defnlibxname{cpp_lib_gcd_lcm}@ 201606L // also in \libheader{numeric} +#define @\defnlibxname{cpp_lib_function_ref}@ 202306L // freestanding, also in \libheader{functional} +#define @\defnlibxname{cpp_lib_gcd_lcm}@ 201606L // freestanding, also in \libheader{numeric} #define @\defnlibxname{cpp_lib_generator}@ 202207L // also in \libheader{generator} #define @\defnlibxname{cpp_lib_generic_associative_lookup}@ 201304L // also in \libheader{map}, \libheader{set} #define @\defnlibxname{cpp_lib_generic_unordered_lookup}@ 201811L @@ -724,7 +724,7 @@ #define @\defnlibxname{cpp_lib_indirect}@ 202502L // also in \libheader{memory} #define @\defnlibxname{cpp_lib_inplace_vector}@ 202406L // also in \libheader{inplace_vector} #define @\defnlibxname{cpp_lib_int_pow2}@ 202002L // freestanding, also in \libheader{bit} -#define @\defnlibxname{cpp_lib_integer_comparison_functions}@ 202002L // also in \libheader{utility} +#define @\defnlibxname{cpp_lib_integer_comparison_functions}@ 202002L // freestanding, also in \libheader{utility} #define @\defnlibxname{cpp_lib_integer_sequence}@ 201304L // freestanding, also in \libheader{utility} #define @\defnlibxname{cpp_lib_integral_constant_callable}@ 201304L // freestanding, also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_interpolate}@ 201902L // also in \libheader{cmath}, \libheader{numeric} @@ -741,7 +741,7 @@ #define @\defnlibxname{cpp_lib_is_null_pointer}@ 201309L // freestanding, also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_pointer_interconvertible}@ 201907L // freestanding, also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_scoped_enum}@ 202011L // freestanding, also in \libheader{type_traits} -#define @\defnlibxname{cpp_lib_is_sufficiently_aligned}@ 202411L // also in \libheader{memory} +#define @\defnlibxname{cpp_lib_is_sufficiently_aligned}@ 202411L // freestanding, also in \libheader{memory} #define @\defnlibxname{cpp_lib_is_swappable}@ 201603L // freestanding, also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_virtual_base_of}@ 202406L // freestanding, also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_within_lifetime}@ 202306L // freestanding, also in \libheader{type_traits} @@ -790,18 +790,18 @@ #define @\defnlibxname{cpp_lib_ranges_chunk}@ 202202L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_chunk_by}@ 202202L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_concat}@ 202403L // freestanding, also in \libheader{ranges} -#define @\defnlibxname{cpp_lib_ranges_contains}@ 202207L // also in \libheader{algorithm} -#define @\defnlibxname{cpp_lib_ranges_enumerate}@ 202302L // also in \libheader{ranges} -#define @\defnlibxname{cpp_lib_ranges_find_last}@ 202207L // also in \libheader{algorithm} -#define @\defnlibxname{cpp_lib_ranges_fold}@ 202207L // also in \libheader{algorithm} +#define @\defnlibxname{cpp_lib_ranges_contains}@ 202207L // freestanding, also in \libheader{algorithm} +#define @\defnlibxname{cpp_lib_ranges_enumerate}@ 202302L // freestanding, also in \libheader{ranges} +#define @\defnlibxname{cpp_lib_ranges_find_last}@ 202207L // freestanding, also in \libheader{algorithm} +#define @\defnlibxname{cpp_lib_ranges_fold}@ 202207L // freestanding, also in \libheader{algorithm} #define @\defnlibxname{cpp_lib_ranges_generate_random}@ 202403L // also in \libheader{random} #define @\defnlibxname{cpp_lib_ranges_indices}@ 202506L // also in \libheader{ranges} -#define @\defnlibxname{cpp_lib_ranges_iota}@ 202202L // also in \libheader{numeric} +#define @\defnlibxname{cpp_lib_ranges_iota}@ 202202L // freestanding, also in \libheader{numeric} #define @\defnlibxname{cpp_lib_ranges_join_with}@ 202202L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_repeat}@ 202207L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_reserve_hint}@ 202502L // also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_slide}@ 202202L // freestanding, also in \libheader{ranges} -#define @\defnlibxname{cpp_lib_ranges_starts_ends_with}@ 202106L // also in \libheader{algorithm} +#define @\defnlibxname{cpp_lib_ranges_starts_ends_with}@ 202106L // freestanding, also in \libheader{algorithm} #define @\defnlibxname{cpp_lib_ranges_stride}@ 202207L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_to_container}@ 202202L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_to_input}@ 202502L // freestanding, also in \libheader{ranges} @@ -816,9 +816,9 @@ #define @\defnlibxname{cpp_lib_remove_cvref}@ 201711L // freestanding, also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_result_of_sfinae}@ 201210L // freestanding, also in \libheader{functional}, \libheader{type_traits} -#define @\defnlibxname{cpp_lib_robust_nonmodifying_seq_ops}@ 201304L // also in \libheader{algorithm} -#define @\defnlibxname{cpp_lib_sample}@ 201603L // also in \libheader{algorithm} -#define @\defnlibxname{cpp_lib_saturation_arithmetic}@ 202311L // also in \libheader{numeric} +#define @\defnlibxname{cpp_lib_robust_nonmodifying_seq_ops}@ 201304L // freestanding, also in \libheader{algorithm} +#define @\defnlibxname{cpp_lib_sample}@ 201603L // freestanding, also in \libheader{algorithm} +#define @\defnlibxname{cpp_lib_saturation_arithmetic}@ 202311L // freestanding, also in \libheader{numeric} #define @\defnlibxname{cpp_lib_scoped_lock}@ 201703L // also in \libheader{mutex} #define @\defnlibxname{cpp_lib_semaphore}@ 201907L // also in \libheader{semaphore} #define @\defnlibxname{cpp_lib_senders}@ 202506L // also in \libheader{execution} @@ -5748,6 +5748,10 @@ with a base characteristic of \tcode{inte\-gral_constant}. +\pnum +If an explicit specialization or partial specialization of \tcode{type_order} is declared, +the program is ill-formed. + \pnum \recommended The order should be lexicographical on parameter-type-lists and template argument lists. diff --git a/source/text.tex b/source/text.tex index abdd2dd2ba..0e89fc5e83 100644 --- a/source/text.tex +++ b/source/text.tex @@ -8784,7 +8784,7 @@ template constexpr bool enable_nonlocking_formatter_optimization<@\placeholder{pair-or-tuple}@> = - (enable_nonlocking_formatter_optimization && ...); + (enable_nonlocking_formatter_optimization> && ...); } \end{codeblock} diff --git a/source/threads.tex b/source/threads.tex index db30cf641a..0993114258 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -3239,14 +3239,10 @@ \pnum \begin{note} -Hardware could require an object -referenced by an \tcode{atomic_ref} -to have stricter alignment\iref{basic.align} -than other objects of type \tcode{T}. -Further, whether operations on an \tcode{atomic_ref} -are lock-free could depend on the alignment of the referenced object. -For example, lock-free operations on \tcode{std::complex} -could be supported only if aligned to \tcode{2*alignof(double)}. +An implementation can choose to define +\tcode{atomic_ref::required_alignment} +to a value greater than \tcode{alignof(T)} in order to ensure that +operations on all objects of type \tcode{atomic_ref} are lock-free. \end{note} \end{itemdescr} @@ -9556,17 +9552,17 @@ void wait(unique_lock& lock, Predicate pred); template cv_status wait_until(unique_lock& lock, - const chrono::time_point& abs_time); + chrono::time_point abs_time); template bool wait_until(unique_lock& lock, - const chrono::time_point& abs_time, + chrono::time_point abs_time, Predicate pred); template cv_status wait_for(unique_lock& lock, - const chrono::duration& rel_time); + chrono::duration rel_time); template bool wait_for(unique_lock& lock, - const chrono::duration& rel_time, + chrono::duration rel_time, Predicate pred); using native_handle_type = @\impdefnc@; // see~\ref{thread.req.native} @@ -9732,7 +9728,7 @@ \begin{itemdecl} template cv_status wait_until(unique_lock& lock, - const chrono::time_point& abs_time); + chrono::time_point abs_time); \end{itemdecl} \begin{itemdescr} @@ -9794,7 +9790,7 @@ \begin{itemdecl} template cv_status wait_for(unique_lock& lock, - const chrono::duration& rel_time); + chrono::duration rel_time); \end{itemdecl} \begin{itemdescr} @@ -9845,7 +9841,7 @@ \begin{itemdecl} template bool wait_until(unique_lock& lock, - const chrono::time_point& abs_time, + chrono::time_point abs_time, Predicate pred); \end{itemdecl} @@ -9900,7 +9896,7 @@ \begin{itemdecl} template bool wait_for(unique_lock& lock, - const chrono::duration& rel_time, + chrono::duration rel_time, Predicate pred); \end{itemdecl} @@ -9996,24 +9992,24 @@ void wait(Lock& lock, Predicate pred); template - cv_status wait_until(Lock& lock, const chrono::time_point& abs_time); + cv_status wait_until(Lock& lock, chrono::time_point abs_time); template - bool wait_until(Lock& lock, const chrono::time_point& abs_time, + bool wait_until(Lock& lock, chrono::time_point - cv_status wait_for(Lock& lock, const chrono::duration& rel_time); + cv_status wait_for(Lock& lock, chrono::duration rel_time); template - bool wait_for(Lock& lock, const chrono::duration& rel_time, Predicate pred); + bool wait_for(Lock& lock, chrono::duration rel_time, Predicate pred); // \ref{thread.condvarany.intwait}, interruptible waits template bool wait(Lock& lock, stop_token stoken, Predicate pred); template bool wait_until(Lock& lock, stop_token stoken, - const chrono::time_point& abs_time, Predicate pred); + chrono::time_point abs_time, Predicate pred); template bool wait_for(Lock& lock, stop_token stoken, - const chrono::duration& rel_time, Predicate pred); + chrono::duration rel_time, Predicate pred); }; } \end{codeblock} @@ -10138,7 +10134,7 @@ \indexlibrarymember{wait_until}{condition_variable_any}% \begin{itemdecl} template - cv_status wait_until(Lock& lock, const chrono::time_point& abs_time); + cv_status wait_until(Lock& lock, chrono::time_point abs_time); \end{itemdecl} \begin{itemdescr} @@ -10189,7 +10185,7 @@ \indexlibrarymember{wait_for}{condition_variable_any}% \begin{itemdecl} template - cv_status wait_for(Lock& lock, const chrono::duration& rel_time); + cv_status wait_for(Lock& lock, chrono::duration rel_time); \end{itemdecl} \begin{itemdescr} @@ -10227,7 +10223,7 @@ \indexlibrarymember{wait_until}{condition_variable_any}% \begin{itemdecl} template - bool wait_until(Lock& lock, const chrono::time_point& abs_time, Predicate pred); + bool wait_until(Lock& lock, chrono::time_point abs_time, Predicate pred); \end{itemdecl} \begin{itemdescr} @@ -10257,7 +10253,7 @@ \indexlibrarymember{wait_for}{condition_variable_any}% \begin{itemdecl} template - bool wait_for(Lock& lock, const chrono::duration& rel_time, Predicate pred); + bool wait_for(Lock& lock, chrono::duration rel_time, Predicate pred); \end{itemdecl} \begin{itemdescr} @@ -10323,7 +10319,7 @@ \begin{itemdecl} template bool wait_until(Lock& lock, stop_token stoken, - const chrono::time_point& abs_time, Predicate pred); + chrono::time_point abs_time, Predicate pred); \end{itemdecl} \begin{itemdescr} @@ -10376,7 +10372,7 @@ \begin{itemdecl} template bool wait_for(Lock& lock, stop_token stoken, - const chrono::duration& rel_time, Predicate pred); + chrono::duration rel_time, Predicate pred); \end{itemdecl} \begin{itemdescr} diff --git a/source/time.tex b/source/time.tex index 67b1b06b47..2e9e2c975f 100644 --- a/source/time.tex +++ b/source/time.tex @@ -1351,13 +1351,17 @@ \begin{itemdescr} \pnum \constraints -No overflow is induced in the conversion and -\tcode{treat_as_floating_point_v} is \tcode{true} or both -\tcode{ratio_divide::den} is \tcode{1} and +\tcode{is_convertible_v} is \tcode{true}. +\tcode{ratio_divide} is a valid ratio specialization. +Either: +\begin{itemize} +\item \tcode{treat_as_floating_point_v} is \tcode{true}; or +\item \tcode{ratio_divide::den} is \tcode{1} and \tcode{treat_as_floating_point_v} is \tcode{false}. +\end{itemize} \begin{note} This -requirement prevents implicit truncation error when converting between +requirement prevents implicit truncation errors when converting between integral-based \tcode{duration} types. Such a construction could easily lead to confusion about the value of the \tcode{duration}. \end{note} @@ -3529,6 +3533,9 @@ \end{itemdecl} \begin{itemdescr} +\constraints +\tcode{os << sys_time{lt.time_since_epoch()}} is a valid expression. + \pnum \effects \begin{codeblock} @@ -8523,19 +8530,22 @@ \begin{itemize} \item Initializes \tcode{is_neg} with \tcode{d < Duration::zero()}. + Let \exposid{ABS_D} represent + \tcode{-d} if \tcode{is_neg} is \tcode{true} and + \tcode{d} otherwise. \item - Initializes \tcode{h} with \tcode{duration_cast(abs(d))}. + Initializes \tcode{h} with \tcode{duration_cast(\exposid{ABS_D})}. \item Initializes \tcode{m} - with \tcode{duration_cast(abs(d) - hours())}. + with \tcode{duration_cast(\exposid{ABS_D} - hours())}. \item Initializes \tcode{s} - with \tcode{duration_cast(abs(d) - hours() - minutes())}. + with \tcode{duration_cast(\exposid{ABS_D} - hours() - minutes())}. \item If \tcode{treat_as_floating_point_v} is \tcode{true}, - initializes \tcode{ss} with \tcode{abs(d) - hours() - minutes() - seconds()}. + initializes \tcode{ss} with \tcode{\exposid{ABS_D} - hours() - minutes() - seconds()}. Otherwise, initializes \tcode{ss} - with \tcode{duration_cast(abs(d) - hours() - minutes() - seconds())}. + with \tcode{duration_cast(\exposid{ABS_D} - hours() - minutes() - seconds())}. \end{itemize} \begin{note} When \tcode{precision::rep} is integral and diff --git a/source/utilities.tex b/source/utilities.tex index f704f0dae7..61fa81c37b 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -4925,6 +4925,7 @@ \pnum \mandates +\tcode{U} is a valid contained type for \tcode{optional}. The declaration \begin{codeblock} U u(invoke(std::forward(f), *@\exposid{val}@)); @@ -5251,7 +5252,12 @@ \pnum \effects -Equivalent to: \tcode{return x.has_value() ? *x == v : false;} +Equivalent to: +\begin{codeblock} +if (x.has_value()) + return *x == v; +return false; +\end{codeblock} \end{itemdescr} \indexlibrarymember{operator==}{optional}% @@ -5268,7 +5274,12 @@ \pnum \effects -Equivalent to: \tcode{return x.has_value() ? v == *x : false;} +Equivalent to: +\begin{codeblock} +if (x.has_value()) + return *x == v; +return false; +\end{codeblock} \end{itemdescr} \indexlibrarymember{operator"!=}{optional}% @@ -5285,7 +5296,12 @@ \pnum \effects -Equivalent to: \tcode{return x.has_value() ? *x != v : true;} +Equivalent to: +\begin{codeblock} +if (x.has_value()) + return *x != v; +return true; +\end{codeblock} \end{itemdescr} \indexlibrarymember{operator"!=}{optional}% @@ -5302,7 +5318,12 @@ \pnum \effects -Equivalent to: \tcode{return x.has_value() ? v != *x : true;} +Equivalent to: +\begin{codeblock} +if (x.has_value()) + return *x != v; +return true; +\end{codeblock} \end{itemdescr} \indexlibrarymember{operator<}{optional}% @@ -5319,7 +5340,12 @@ \pnum \effects -Equivalent to: \tcode{return x.has_value() ? *x < v : true;} +Equivalent to: +\begin{codeblock} +if (x.has_value()) + return *x < v; +return true; +\end{codeblock} \end{itemdescr} \indexlibrarymember{operator<}{optional}% @@ -5336,7 +5362,12 @@ \pnum \effects -Equivalent to: \tcode{return x.has_value() ? v < *x : false;} +Equivalent to: +\begin{codeblock} +if (x.has_value()) + return v == *x; +return false; +\end{codeblock} \end{itemdescr} \indexlibrarymember{operator>}{optional}% @@ -5353,7 +5384,12 @@ \pnum \effects -Equivalent to: \tcode{return x.has_value() ? *x > v : false;} +Equivalent to: +\begin{codeblock} +if (x.has_value()) + return *x > v; +return false; +\end{codeblock} \end{itemdescr} \indexlibrarymember{operator>}{optional}% @@ -5370,7 +5406,12 @@ \pnum \effects -Equivalent to: \tcode{return x.has_value() ? v > *x : true;} +Equivalent to: +\begin{codeblock} +if (x.has_value()) + return v > *x; +return true; +\end{codeblock} \end{itemdescr} \indexlibrarymember{operator<=}{optional}% @@ -5387,7 +5428,12 @@ \pnum \effects -Equivalent to: \tcode{return x.has_value() ? *x <= v : true;} +Equivalent to: +\begin{codeblock} +if (x.has_value()) + return *x <= v; +return true; +\end{codeblock} \end{itemdescr} \indexlibrarymember{operator<=}{optional}% @@ -5404,7 +5450,12 @@ \pnum \effects -Equivalent to: \tcode{return x.has_value() ? v <= *x : false;} +Equivalent to: +\begin{codeblock} +if (x.has_value()) + return v <= *x; +return false; +\end{codeblock} \end{itemdescr} \indexlibrarymember{operator>=}{optional}% @@ -5421,7 +5472,12 @@ \pnum \effects -Equivalent to: \tcode{return x.has_value() ? *x >= v : false;} +Equivalent to: +\begin{codeblock} +if (x.has_value()) + return *x >= v; +return false; +\end{codeblock} \end{itemdescr} \indexlibrarymember{operator>=}{optional}% @@ -5438,7 +5494,12 @@ \pnum \effects -Equivalent to: \tcode{return x.has_value() ? v >= *x : true;} +Equivalent to: +\begin{codeblock} +if (x.has_value()) + return v >= *x; +return true; +\end{codeblock} \end{itemdescr} \indexlibrarymember{operator<=>}{optional}% @@ -5489,8 +5550,8 @@ begins with a type \grammarterm{template-argument}. \pnum -\returns -\tcode{optional>(std::forward(v))}. +\effects +Equivalent to: \tcode{return optional>(std::forward(v));} \end{itemdescr} \indexlibraryglobal{make_optional}% @@ -5678,7 +5739,7 @@ public: // \ref{variant.ctor}, constructors constexpr variant() noexcept(@\seebelow@); - constexpr variant(const variant&); + constexpr variant(const variant&) noexcept(@\seebelow@); constexpr variant(variant&&) noexcept(@\seebelow@); template @@ -5793,7 +5854,7 @@ \indexlibraryctor{variant}% \begin{itemdecl} -constexpr variant(const variant& w); +constexpr variant(const variant& w) noexcept(@\seebelow@); \end{itemdecl} \begin{itemdescr} @@ -5814,6 +5875,10 @@ \tcode{is_copy_constructible_v<$\tcode{T}_i$>} is \tcode{true} for all $i$. If \tcode{is_trivially_copy_constructible_v<$\tcode{T}_i$>} is \tcode{true} for all $i$, this constructor is trivial. +The exception specification is equivalent to the logical AND of +%FIXME: The paper puts the "AND" in math font and I have no idea +%what markup this is supposed to be in the standard. +\tcode{is_nothrow_copy_constructible_v<$\tcode{T}_i$>} for all $i$. \end{itemdescr} \indexlibraryctor{variant}% @@ -9403,7 +9468,9 @@ \pnum \returns -\tcode{x.has_value() \&\& static_cast(*x == v)}. +If \tcode{x.has_value()} is \tcode{true}, +\tcode{*x == v}; +otherwise \tcode{false}. \end{itemdescr} \indexlibrarymember{operator==}{expected}% @@ -9419,7 +9486,9 @@ \pnum \returns -\tcode{!x.has_value() \&\& static_cast(x.error() == e.error())}. +If \tcode{x.has_value()} is \tcode{true}, +\tcode{x.error() == e.error()}; +otherwise \tcode{false}. \end{itemdescr} \rSec2[expected.void]{Partial specialization of \tcode{expected} for \tcode{void} types} @@ -10341,7 +10410,8 @@ \pnum \returns If \tcode{x.has_value()} does not equal \tcode{y.has_value()}, \tcode{false}; -otherwise \tcode{x.has_value() || static_cast(x.error() == y.error())}. +otherwise if \tcode{x.has_value()} is \tcode{true}, \tcode{true}; +otherwise \tcode{x.error() == y.error()}. \end{itemdescr} \indexlibrarymember{operator==}{expected}% @@ -10358,7 +10428,9 @@ \pnum \returns -\tcode{!x.has_value() \&\& static_cast(x.error() == e.error())}. +If \tcode{!x.has_value()} is \tcode{true}, +\tcode{x.error() == e.error()}; +otherwise \tcode{false}. \end{itemdescr} \rSec1[bitset]{Bitsets} @@ -10629,6 +10701,15 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\constraints +\begin{itemize} +\item \tcode{is_array_v} is \tcode{false}, +\item \tcode{is_trivially_copyable_v} is \tcode{true}, +\item \tcode{is_standard_layout_v} is \tcode{true}, and +\item \tcode{is_trivially_default_constructible_v} is \tcode{true}. +\end{itemize} + \pnum \effects As if by: @@ -14261,12 +14342,12 @@ \tcode{*this} has no target object if any of the following hold: \begin{itemize} \item -\tcode{f} is a null function pointer value, or +\tcode{f} is a null function pointer value, \item \tcode{f} is a null member pointer value, or \item \tcode{remove_cvref_t} is a specialization of -the \tcode{move_only_function} class template, +the \tcode{move_only_function} or \tcode{copyable_function} class template, and \tcode{f} has no target object. \end{itemize} Otherwise, \tcode{*this} has a target object of type \tcode{VT} @@ -15094,7 +15175,7 @@ \pnum \constraints -\tcode{\exposid{is-invocable-using}} is \tcode{true}. +\tcode{\exposid{is-invocable-using}} is \tcode{true}. \pnum \mandates @@ -15128,7 +15209,7 @@ \constraints \begin{itemize} \item \tcode{is_rvalue_reference_v} is \tcode{false}, and -\item \tcode{\exposid{is-invocable-using}} is \tcode{true}. +\item \tcode{\exposid{is-invocable-using}} is \tcode{true}. \end{itemize} \pnum @@ -15159,7 +15240,7 @@ \pnum \constraints -\tcode{\exposid{is-invocable-using}} is \tcode{true}. +\tcode{\exposid{is-invocable-using}} is \tcode{true}. \pnum \mandates @@ -15265,7 +15346,7 @@ in which case let \tcode{R} be \tcode{invoke_result_t}, \tcode{A...} be an empty pack, and -\tcode{E} be \tcode{false}, or +\tcode{E} be \tcode{true}, or \item \tcode{F} is of the form \tcode{R(*)(G, A...) noexcept(E)} for a type \tcode{G}.