diff --git a/concepts.tex b/concepts.tex index f5401bbb..e45b1981 100644 --- a/concepts.tex +++ b/concepts.tex @@ -316,7 +316,7 @@ } \end{codeblock} and let \tcode{f} be a function with no arguments and return type \tcode{From} -such that \tcode{f()} is equality preserving. Then +such that \tcode{f()} is equality preserving. \tcode{ConvertibleTo} is satisfied only if: \begin{itemize} @@ -490,7 +490,7 @@ otherwise, let \tcode{v} be an rvalue of type \tcode{R}. Let \tcode{uu} be a distinct object of type \tcode{R} such that \tcode{uu} is equal to \tcode{v}. -Then \tcode{Assignable} is satisfied only if +\tcode{Assignable} is satisfied only if \begin{itemize} \item \tcode{addressof(t = v) == addressof(t)}. @@ -515,7 +515,9 @@ template concept bool SwappableWith = - CommonReference && + CommonReference< + const remove_reference_t&, + const remove_reference_t&>() && requires(T&& t, U&& u) { ranges::swap(std::forward(t), std::forward(t)); ranges::swap(std::forward(u), std::forward(u)); @@ -604,33 +606,31 @@ \begin{itemdecl} template concept bool Boolean = - MoveConstructible && // (see \ref{concepts.lib.object.moveconstructible}) - requires(const B b1, const B b2, const bool a) { - bool(b1); - { b1 } -> bool; - bool(!b1); - { !b1 } -> bool; - { b1 && b2 } -> Same; - { b1 && a } -> Same; - { a && b1 } -> Same; - { b1 || b2 } -> Same; - { b1 || a } -> Same; - { a || b1 } -> Same; - { b1 == b2 } -> bool; - { b1 != b2 } -> bool; - { b1 == a } -> bool; - { a == b1 } -> bool; - { b1 != a } -> bool; - { a != b1 } -> bool; + Movable> && // (see \ref{concepts.lib.object.movable}) + requires(const remove_reference_t& b1, + const remove_reference_t& b2, const bool a) { + { b1 } -> ConvertibleTo&&; + { !b1 } -> ConvertibleTo&&; + { b1 && a } -> Same&&; + { b1 || a } -> Same&&; + { b1 && b2 } -> Same&&; + { a && b2 } -> Same&&; + { b1 || b2 } -> Same&&; + { a || b2 } -> Same&&; + { b1 == b2 } -> ConvertibleTo&&; + { b1 == a } -> ConvertibleTo&&; + { a == b2 } -> ConvertibleTo&&; + { b1 != b2 } -> ConvertibleTo&&; + { b1 != a } -> ConvertibleTo&&; + { a != b2 } -> ConvertibleTo&&; }; \end{itemdecl} \pnum -Given values \tcode{b1} and \tcode{b2} of type \tcode{B}, then -\tcode{Boolean} is satisfied only if +Given \tcode{const} lvalues \tcode{b1} and \tcode{b2} of type +\tcode{remove_reference_t}, then \tcode{Boolean} is satisfied only if \begin{itemize} -\item \tcode{bool(b1) == [](bool x) \{ return x; \}(b1)}. \item \tcode{bool(b1) == !bool(!b1)}. \item \tcode{(b1 \&\& b2)}, \tcode{(b1 \&\& bool(b2))}, and \tcode{(bool(b1) \&\& b2)} are all equal to @@ -655,18 +655,20 @@ \begin{itemdecl} template concept bool WeaklyEqualityComparableWith = - requires(const T& t, const U& u) { - { t == u } -> Boolean; - { u == t } -> Boolean; - { t != u } -> Boolean; - { u != t } -> Boolean; + requires(const remove_reference_t& t, + const remove_reference_t& u) { + { t == u } -> Boolean&&; + { t != u } -> Boolean&&; + { u == t } -> Boolean&&; + { u != t } -> Boolean&&; }; \end{itemdecl} \begin{itemdescr} \pnum -Let \tcode{t} and \tcode{u} be objects of types \tcode{T} and \tcode{U} respectively. -\tcode{WeaklyEqualityComparableWith} is satisfied only if: +Let \tcode{t} and \tcode{u} be \tcode{const} lvalues of types +\tcode{remove_reference_t} and \tcode{remove_reference_t} respectively. +\tcode{Weakly\-Equality\-Comparable\-With} is satisfied only if: \begin{itemize} \item \tcode{t == u}, \tcode{u == t}, \tcode{t != u}, and \tcode{u != t} have the same domain. @@ -700,19 +702,25 @@ \begin{itemdecl} template concept bool EqualityComparableWith = - CommonReference && EqualityComparable && EqualityComparable && + CommonReference< + const remove_reference_t&, + const remove_reference_t&> && EqualityComparable< - remove_cv_t>>> && + common_reference_t< + const remove_reference_t&, + const remove_reference_t&>> && WeaklyEqualityComparableWith; +} \end{itemdecl} \begin{itemdescr} \pnum -Let \tcode{t} be an object of type \tcode{T}, \tcode{u} be an object of type \tcode{U}, and \tcode{C} be -\tcode{common_reference_t}. -Then \tcode{EqualityComparableWith} is satisfied only if: +Let \tcode{t} be a \tcode{const} lvalue of type \tcode{remove_reference_t}, \tcode{u} be a +\tcode{const} lvalue of type \tcode{remove_reference_t}, and \tcode{C} be +\tcode{common_reference_t\&, const remove_reference_t\&>}. +\tcode{EqualityComparableWith} is satisfied only if: \begin{itemize} \item \tcode{bool(t == u) == bool(C(t) == C(u))}. @@ -726,18 +734,19 @@ template concept bool StrictTotallyOrdered = EqualityComparable && - requires(const T a, const T b) { - { a < b } -> Boolean; - { a > b } -> Boolean; - { a <= b } -> Boolean; - { a >= b } -> Boolean; + requires(const remove_reference_t& t, + const remove_reference_t& u) { + { a < b } -> Boolean&&; + { a > b } -> Boolean&&; + { a <= b } -> Boolean&&; + { a >= b } -> Boolean&&; }; \end{itemdecl} \begin{itemdescr} \pnum -Let \tcode{a}, \tcode{b}, and \tcode{c} be objects of type \tcode{T}. -Then \tcode{StrictTotallyOrdered} is satisfied only if +Let \tcode{a}, \tcode{b}, and \tcode{c} be \tcode{const} lvalues of type \tcode{remove_reference_t}. +\tcode{StrictTotallyOrdered} is satisfied only if \begin{itemize} \item Exactly one of \tcode{bool(a < b)}, \tcode{bool(a > b)}, or @@ -754,30 +763,36 @@ \begin{itemdecl} template concept bool StrictTotallyOrderedWith = - CommonReference && StrictTotallyOrdered && StrictTotallyOrdered && + CommonReference< + const remove_reference_t&, + const remove_reference_t&> && StrictTotallyOrdered< - remove_cv_t>>> && + common_reference_t< + const remove_reference_t&, + const remove_reference_t&>> && EqualityComparableWith && - requires(const T t, const U u) { - { t < u } -> Boolean; - { t > u } -> Boolean; - { t <= u } -> Boolean; - { t >= u } -> Boolean; - { u < t } -> Boolean; - { u > t } -> Boolean; - { u <= t } -> Boolean; - { u >= t } -> Boolean; + requires(const remove_reference_t& t, + const remove_reference_t& u) { + { t < u } -> Boolean&&; + { t > u } -> Boolean&&; + { t <= u } -> Boolean&&; + { t >= u } -> Boolean&&; + { u < t } -> Boolean&&; + { u > t } -> Boolean&&; + { u <= t } -> Boolean&&; + { u >= t } -> Boolean&&; }; \end{itemdecl} \begin{itemdescr} \pnum -Let \tcode{t} be an object of type T, \tcode{u} be an object -of type \tcode{U}, and \tcode{C} be -\tcode{common_reference_t}. -Then \tcode{StrictTotallyOrderedWith} is satisfied only if +Let \tcode{t} be a \tcode{const} lvalue of type \tcode{remove_reference_t}, +\tcode{u} be a \tcode{const} lvalue of type \tcode{remove_reference_t}, +and \tcode{C} be \tcode{common_reference_t\&, +const remove_reference_t\&>}. +\tcode{StrictTotallyOrderedWith} is satisfied only if \begin{itemize} \item \tcode{bool(t < u) == bool(C(t) < C(u)).} @@ -899,7 +914,7 @@ Let \tcode{U} be the type \tcode{remove_cv_t}, \tcode{rv} be an rvalue of type \tcode{U}, and \tcode{u2} be a distinct object of type \tcode{T} equal to \tcode{rv}. -Then \tcode{MoveConstructible} is satisfied only if +\tcode{MoveConstructible} is satisfied only if \begin{itemize} \item After the definition \tcode{T u = rv;}, \tcode{u} is equal to \tcode{u2}. @@ -928,7 +943,7 @@ \pnum Let \tcode{v} be an lvalue of type (possibly \tcode{const}) \tcode{remove_cv_t} or an rvalue of type \tcode{const remove_cv_t}. -Then \tcode{CopyConstructible} is satisfied only if +\tcode{CopyConstructible} is satisfied only if \begin{itemize} \item After the definition \tcode{T u = v;}, \tcode{u} is equal @@ -1068,21 +1083,28 @@ concept bool Relation = Predicate && Predicate && - CommonReference && + CommonReference< + const remove_reference_t&, + const remove_reference_t&> && Predicate, - common_reference_t> && + common_reference_t< + const remove_reference_t&, + const remove_reference_t&>, + common_reference_t< + const remove_reference_t&, + const remove_reference_t&>> && Predicate && Predicate; \end{itemdecl} \begin{itemdescr} \pnum -Let \tcode{r} be any object of type \tcode{R}, \tcode{t} be any -object of type \tcode{T}, \tcode{u} be any -object of type \tcode{U}, and \tcode{C} be -\tcode{common_reference_t}. -Then \tcode{Relation} is satisfied only if +Let \tcode{r} be an expression such that \tcode{decltype((r))} is \tcode{R}, +\tcode{t} be an expression such that \tcode{decltype((t))} is \tcode{T}, +\tcode{u} be an expression such that \tcode{decltype((u))} is \tcode{U}, +and \tcode{C} be \tcode{common_reference_t\&, +const remove_reference_t\&>}. +\tcode{Relation} is satisfied only if \begin{itemize} \item \tcode{bool(r(t, u)) == bool(r(C(t), C(u))).} diff --git a/iterators.tex b/iterators.tex index c1dd0e2c..5af8309e 100644 --- a/iterators.tex +++ b/iterators.tex @@ -996,7 +996,7 @@ \pnum Let \tcode{E} be an an expression such that \tcode{decltype((E))} is \tcode{T}, and let \tcode{o} -be a dereferenceable object of type \tcode{Out}. Then \tcode{Writable} is satisfied only if +be a dereferenceable object of type \tcode{Out}. \tcode{Writable} is satisfied only if \begin{itemize} \item If \tcode{Readable \&\& Same, decay_t{>}} is satisfied, @@ -1040,7 +1040,7 @@ \pnum Let \tcode{i} be an object of type \tcode{I}. When both pre- and post-increment -are valid, \tcode{i} is said to be \techterm{incrementable}. Then +are valid, \tcode{i} is said to be \techterm{incrementable}. \tcode{WeaklyIncrementable} is satisfied only if \begin{itemize} @@ -1080,7 +1080,7 @@ \pnum Let \tcode{a} and \tcode{b} be incrementable objects of type \tcode{I}. -Then \tcode{Incrementable} is satisfied only if +\tcode{Incrementable} is satisfied only if \begin{itemize} \item If \tcode{bool(a == b)} then \tcode{bool(a++ == b)}. @@ -1252,7 +1252,7 @@ \pnum Let \tcode{E} be an expression such that \tcode{decltype((E))} is \tcode{T}, and let \tcode{i} be a -dereferenceable object of type \tcode{I}. Then \tcode{OutputIterator} is satisfied only if +dereferenceable object of type \tcode{I}. \tcode{OutputIterator} is satisfied only if \tcode{*i++ = E;} has effects equivalent to: \begin{codeblock} *i = E; @@ -1341,7 +1341,7 @@ \tcode{\dcr{}r} and \tcode{r\dcr{}}. \pnum -Let \tcode{a} and \tcode{b} be decrementable objects of type \tcode{I}. Then +Let \tcode{a} and \tcode{b} be decrementable objects of type \tcode{I}. \tcode{BidirectionalIterator} is satisfied only if: \begin{itemize} @@ -1384,7 +1384,7 @@ Let \tcode{a} and \tcode{b} be valid iterators of type \tcode{I} such that \tcode{b} is reachable from \tcode{a}. Let \tcode{n} be the smallest value of type \tcode{difference_type_t} such that after -\tcode{n} applications of \tcode{++a}, then \tcode{bool(a == b)}. Then +\tcode{n} applications of \tcode{++a}, then \tcode{bool(a == b)}. \tcode{RandomAccessIterator} is satisfied only if: \begin{itemize} diff --git a/numerics.tex b/numerics.tex index 90328511..b5e33169 100644 --- a/numerics.tex +++ b/numerics.tex @@ -46,7 +46,7 @@ \exitnote \pnum -Let \tcode{g} be any object of type \tcode{G}. Then +Let \tcode{g} be any object of type \tcode{G}. \tcode{UniformRandomNumberGenerator} is satisfied only if \begin{itemize}