|
150 | 150 | The following type \tcode{T} meets the explicitly stated syntactic requirements |
151 | 151 | of concept \tcode{C} above but does not meet the additional implicit |
152 | 152 | requirements: |
153 | | - |
154 | 153 | \begin{codeblock} |
155 | 154 | struct T { |
156 | 155 | bool operator==(const T&) const { return true; } |
|
365 | 364 | such that \tcode{f()} is equality-preserving. |
366 | 365 | Types \tcode{From} and \tcode{To} model \tcode{\libconcept{convertible_to}<From, To>} |
367 | 366 | only if: |
368 | | - |
369 | 367 | \begin{itemize} |
370 | 368 | \item |
371 | 369 | \tcode{To} is not an object or reference-to-object type, or |
372 | 370 | \tcode{static_cast<To>(f())} is equal to \tcode{test(f)}. |
373 | 371 |
|
374 | 372 | \item |
375 | 373 | \tcode{FromR} is not a reference-to-object type, or |
376 | | - |
377 | 374 | \begin{itemize} |
378 | 375 | \item |
379 | 376 | If \tcode{FromR} is an rvalue reference to a non const-qualified type, the |
|
486 | 483 | Users can customize the behavior of \libconcept{common_with} by specializing the |
487 | 484 | \tcode{common_type} class template\iref{meta.trans.other}. |
488 | 485 | \end{note} |
489 | | - |
490 | 486 | \end{itemdescr} |
491 | 487 |
|
492 | 488 | \rSec2[concepts.arithmetic]{Arithmetic concepts} |
|
540 | 536 | \end{itemize} |
541 | 537 | \tcode{LHS} and \tcode{RHS} model |
542 | 538 | \tcode{\libconcept{assignable_from}<LHS, RHS>} only if |
543 | | - |
544 | 539 | \begin{itemize} |
545 | 540 | \item \tcode{addressof(lhs = rhs) == addressof(lcopy)}. |
546 | 541 |
|
547 | 542 | \item After evaluating \tcode{lhs = rhs}: |
548 | | - |
549 | 543 | \begin{itemize} |
550 | 544 | \item \tcode{lhs} is equal to \tcode{rcopy}, unless \tcode{rhs} is a non-const |
551 | 545 | xvalue that refers to \tcode{lcopy}. |
|
600 | 594 | \tcode{ranges::swap(E1, E2)} for subexpressions \tcode{E1} |
601 | 595 | and \tcode{E2} is expression-equivalent to an expression |
602 | 596 | \tcode{S} determined as follows: |
603 | | - |
604 | 597 | \begin{itemize} |
605 | 598 | \item |
606 | 599 | \tcode{S} is \tcode{(void)swap(E1, E2)} |
|
808 | 801 | If \tcode{T} is an object type, then let \tcode{rv} be an rvalue of type |
809 | 802 | \tcode{T} and \tcode{u2} a distinct object of type \tcode{T} equal to |
810 | 803 | \tcode{rv}. \tcode{T} models \libconcept{move_constructible} only if |
811 | | - |
812 | 804 | \begin{itemize} |
813 | 805 | \item After the definition \tcode{T u = rv;}, \tcode{u} is equal to \tcode{u2}. |
814 | 806 |
|
|
835 | 827 | If \tcode{T} is an object type, then let \tcode{v} be an lvalue of type |
836 | 828 | \tcode{T} or \tcode{\keyword{const} T} or an rvalue of type \tcode{\keyword{const} T}. |
837 | 829 | \tcode{T} models \libconcept{copy_constructible} only if |
838 | | - |
839 | 830 | \begin{itemize} |
840 | 831 | \item After the definition \tcode{T u = v;}, |
841 | 832 | \tcode{u} is equal to \tcode{v}\iref{concepts.equality} and |
842 | 833 | \tcode{v} is not modified. |
843 | 834 |
|
844 | 835 | \item \tcode{T(v)} is equal to \tcode{v} and does not modify \tcode{v}. |
845 | 836 | \end{itemize} |
846 | | - |
847 | 837 | \end{itemdescr} |
848 | 838 |
|
849 | 839 | \rSec1[concepts.compare]{Comparison concepts} |
|
882 | 872 | Let \tcode{e} be an expression such that |
883 | 873 | \tcode{decltype((e))} is \tcode{T}. |
884 | 874 | \tcode{T} models \exposconcept{boolean-testable-impl} only if: |
885 | | - |
886 | 875 | \begin{itemize} |
887 | 876 | \item |
888 | 877 | either \tcode{remove_cvref_t<T>} is not a class type, or |
|
900 | 889 | \pnum |
901 | 890 | A \defnadj{disqualifying}{parameter} |
902 | 891 | is a function parameter whose declared type \tcode{P} |
903 | | - |
904 | 892 | \begin{itemize} |
905 | 893 | \item |
906 | 894 | is not dependent on a template parameter, and |
|
948 | 936 |
|
949 | 937 | \pnum |
950 | 938 | A \defnadj{disqualifying}{declaration} is |
951 | | - |
952 | 939 | \begin{itemize} |
953 | 940 | \item |
954 | 941 | a (non-template) function declaration that |
|
1131 | 1118 | Given a type \tcode{T}, let \tcode{a}, \tcode{b}, and \tcode{c} be |
1132 | 1119 | lvalues of type \tcode{const remove_reference_t<T>}. |
1133 | 1120 | \tcode{T} models \libconcept{totally_ordered} only if |
1134 | | - |
1135 | 1121 | \begin{itemize} |
1136 | 1122 | \item Exactly one of \tcode{bool(a < b)}, \tcode{bool(a > b)}, or |
1137 | 1123 | \tcode{bool(a == b)} is \tcode{true}. |
|
1140 | 1126 | \item \tcode{bool(a <= b) == !bool(b < a)}. |
1141 | 1127 | \item \tcode{bool(a >= b) == !bool(a < b)}. |
1142 | 1128 | \end{itemize} |
1143 | | - |
1144 | 1129 | \end{itemdescr} |
1145 | 1130 |
|
1146 | 1131 | \begin{itemdecl} |
|
1339 | 1324 | and |
1340 | 1325 | \tcode{equiv} |
1341 | 1326 | both be transitive relations: |
1342 | | - |
1343 | 1327 | \begin{itemize} |
1344 | 1328 | \item |
1345 | 1329 | \tcode{comp(a, b) \&\& comp(b, c)} |
|
0 commit comments