|
2830 | 2830 | Proj1 proj1 = {}, Proj2 proj2 = {});
|
2831 | 2831 | }
|
2832 | 2832 |
|
2833 |
| - // \ref{alg.3way}, three-way comparison algorithms |
2834 |
| - template<class T, class U> |
2835 |
| - constexpr auto compare_3way(const T& a, const U& b); |
| 2833 | + // \ref{alg.three.way}, three-way comparison algorithms |
2836 | 2834 | template<class InputIterator1, class InputIterator2, class Cmp>
|
2837 | 2835 | constexpr auto
|
2838 |
| - lexicographical_compare_3way(InputIterator1 b1, InputIterator1 e1, |
2839 |
| - InputIterator2 b2, InputIterator2 e2, |
2840 |
| - Cmp comp) |
| 2836 | + lexicographical_compare_three_way(InputIterator1 b1, InputIterator1 e1, |
| 2837 | + InputIterator2 b2, InputIterator2 e2, |
| 2838 | + Cmp comp) |
2841 | 2839 | -> common_comparison_category_t<decltype(comp(*b1, *b2)), strong_ordering>;
|
2842 | 2840 | template<class InputIterator1, class InputIterator2>
|
2843 | 2841 | constexpr auto
|
2844 |
| - lexicographical_compare_3way(InputIterator1 b1, InputIterator1 e1, |
2845 |
| - InputIterator2 b2, InputIterator2 e2); |
| 2842 | + lexicographical_compare_three_way(InputIterator1 b1, InputIterator1 e1, |
| 2843 | + InputIterator2 b2, InputIterator2 e2); |
2846 | 2844 |
|
2847 | 2845 | // \ref{alg.permutation.generators}, permutations
|
2848 | 2846 | template<class BidirectionalIterator>
|
|
8367 | 8365 | \end{note}
|
8368 | 8366 | \end{itemdescr}
|
8369 | 8367 |
|
8370 |
| -\rSec2[alg.3way]{Three-way comparison algorithms} |
| 8368 | +\rSec2[alg.three.way]{Three-way comparison algorithms} |
8371 | 8369 |
|
8372 |
| -\indexlibrary{\idxcode{compare_3way}}% |
8373 |
| -\begin{itemdecl} |
8374 |
| -template<class T, class U> constexpr auto compare_3way(const T& a, const U& b); |
8375 |
| -\end{itemdecl} |
8376 |
| - |
8377 |
| -\begin{itemdescr} |
8378 |
| -\pnum |
8379 |
| -\effects |
8380 |
| -Compares two values and produces a result |
8381 |
| -of the strongest applicable comparison category type: |
8382 |
| -\begin{itemize} |
8383 |
| -\item |
8384 |
| - Returns \tcode{a <=> b} if that expression is well-formed. |
8385 |
| -\item |
8386 |
| - Otherwise, if the expressions \tcode{a == b} and \tcode{a < b} |
8387 |
| - are each well-formed and convertible to \tcode{bool}, |
8388 |
| - returns \tcode{strong_ordering::equal} |
8389 |
| - when \tcode{a == b} is \tcode{true}, |
8390 |
| - otherwise returns \tcode{strong_ordering::less} |
8391 |
| - when \tcode{a < b} is \tcode{true}, |
8392 |
| - and otherwise returns \tcode{strong_ordering::greater}. |
8393 |
| -\item |
8394 |
| - Otherwise, if the expression \tcode{a == b} |
8395 |
| - is well-formed and convertible to \tcode{bool}, |
8396 |
| - returns \tcode{strong_equality::equal} when \tcode{a == b} is \tcode{true}, |
8397 |
| - and otherwise returns \tcode{strong_equality::nonequal}. |
8398 |
| -\item |
8399 |
| - Otherwise, the function is defined as deleted. |
8400 |
| -\end{itemize} |
8401 |
| -\end{itemdescr} |
8402 |
| - |
8403 |
| -\indexlibrary{\idxcode{lexicographical_compare_3way}}% |
| 8370 | +\indexlibrary{\idxcode{lexicographical_compare_three_way}}% |
8404 | 8371 | \begin{itemdecl}
|
8405 | 8372 | template<class InputIterator1, class InputIterator2, class Cmp>
|
8406 | 8373 | constexpr auto
|
8407 |
| - lexicographical_compare_3way(InputIterator1 b1, InputIterator1 e1, |
8408 |
| - InputIterator2 b2, InputIterator2 e2, |
8409 |
| - Cmp comp) |
| 8374 | + lexicographical_compare_three_way(InputIterator1 b1, InputIterator1 e1, |
| 8375 | + InputIterator2 b2, InputIterator2 e2, |
| 8376 | + Cmp comp) |
8410 | 8377 | -> common_comparison_category_t<decltype(comp(*b1, *b2)), strong_ordering>;
|
8411 | 8378 | \end{itemdecl}
|
8412 | 8379 |
|
|
8431 | 8398 | \end{codeblock}
|
8432 | 8399 | \end{itemdescr}
|
8433 | 8400 |
|
8434 |
| -\indexlibrary{\idxcode{lexicographical_compare_3way}}% |
| 8401 | +\indexlibrary{\idxcode{lexicographical_compare_three_way}}% |
8435 | 8402 | \begin{itemdecl}
|
8436 | 8403 | template<class InputIterator1, class InputIterator2>
|
8437 | 8404 | constexpr auto
|
8438 |
| - lexicographical_compare_3way(InputIterator1 b1, InputIterator1 e1, |
8439 |
| - InputIterator2 b2, InputIterator2 e2); |
| 8405 | + lexicographical_compare_three_way(InputIterator1 b1, InputIterator1 e1, |
| 8406 | + InputIterator2 b2, InputIterator2 e2); |
8440 | 8407 | \end{itemdecl}
|
8441 | 8408 |
|
8442 | 8409 | \begin{itemdescr}
|
8443 | 8410 | \pnum
|
8444 | 8411 | \effects
|
8445 | 8412 | Equivalent to:
|
8446 | 8413 | \begin{codeblock}
|
8447 |
| -return lexicographical_compare_3way(b1, e1, b2, e2, |
8448 |
| - [](const auto& t, const auto& u) { |
8449 |
| - return compare_3way(t, u); |
8450 |
| - }); |
| 8414 | +return lexicographical_compare_three_way(b1, e1, b2, e2, compare_three_way()); |
8451 | 8415 | \end{codeblock}
|
8452 | 8416 | \end{itemdescr}
|
8453 | 8417 |
|
|
0 commit comments