|
1677 | 1677 | @\libconcept{convertible_to}@<From, To> &&
|
1678 | 1678 | !@\exposconcept{uses-nonqualification-pointer-conversion}@<decay_t<From>, decay_t<To>>;
|
1679 | 1679 |
|
1680 |
| - template<class T> |
1681 |
| - concept @\defexposconceptnc{pair-like}@ = // \expos |
1682 |
| - !is_reference_v<T> && requires(T t) { |
1683 |
| - typename tuple_size<T>::type; // ensures \tcode{tuple_size<T>} is complete |
1684 |
| - requires @\libconcept{derived_from}@<tuple_size<T>, integral_constant<size_t, 2>>; |
1685 |
| - typename tuple_element_t<0, remove_const_t<T>>; |
1686 |
| - typename tuple_element_t<1, remove_const_t<T>>; |
1687 |
| - { std::get<0>(t) } -> @\libconcept{convertible_to}@<const tuple_element_t<0, T>&>; |
1688 |
| - { std::get<1>(t) } -> @\libconcept{convertible_to}@<const tuple_element_t<1, T>&>; |
1689 |
| - }; |
1690 |
| - |
1691 | 1680 | template<class T, class U, class V>
|
1692 | 1681 | concept @\defexposconceptnc{pair-like-convertible-from}@ = // \expos
|
1693 |
| - !@\libconcept{range}@<T> && @\exposconcept{pair-like}@<T> && |
| 1682 | + !@\libconcept{range}@<T> && !is_reference_v<T> && @\exposconcept{pair-like}@<T> && |
1694 | 1683 | @\libconcept{constructible_from}@<T, U, V> &&
|
1695 | 1684 | @\exposconcept{convertible-to-non-slicing}@<U, tuple_element_t<0, T>> &&
|
1696 | 1685 | @\libconcept{convertible_to}@<V, tuple_element_t<1, T>>;
|
|
7959 | 7948 | namespace std::ranges {
|
7960 | 7949 | template<class T, size_t N>
|
7961 | 7950 | concept @\defexposconcept{has-tuple-element}@ = // \expos
|
7962 |
| - requires(T t) { |
7963 |
| - typename tuple_size<T>::type; |
7964 |
| - requires N < tuple_size_v<T>; |
7965 |
| - typename tuple_element_t<N, T>; |
7966 |
| - { std::get<N>(t) } -> @\libconcept{convertible_to}@<const tuple_element_t<N, T>&>; |
7967 |
| - }; |
| 7951 | + @\exposconcept{tuple-like}@<T> && N < tuple_size_v<T>; |
7968 | 7952 |
|
7969 | 7953 | template<class T, size_t N>
|
7970 | 7954 | concept @\defexposconcept{returnable-element}@ = // \expos
|
|
8594 | 8578 | (!(@\libconcept{bidirectional_range}@<Rs> && ...) && (@\libconcept{common_range}@<Rs> && ...)) ||
|
8595 | 8579 | ((@\libconcept{random_access_range}@<Rs> && ...) && (@\libconcept{sized_range}@<Rs> && ...));
|
8596 | 8580 |
|
8597 |
| - template<class... Ts> |
8598 |
| - using @\exposid{tuple-or-pair}@ = @\seebelow@; // \expos |
8599 |
| - |
8600 | 8581 | template<class F, class Tuple>
|
8601 | 8582 | constexpr auto @\exposid{tuple-transform}@(F&& f, Tuple&& tuple) { // \expos
|
8602 | 8583 | return apply([&]<class... Ts>(Ts&&... elements) {
|
|
8664 | 8645 | }
|
8665 | 8646 | \end{codeblock}
|
8666 | 8647 |
|
8667 |
| -\pnum |
8668 |
| -Given some pack of types \tcode{Ts}, |
8669 |
| -the alias template \exposid{tuple-or-pair} is defined as follows: |
8670 |
| -\begin{itemize} |
8671 |
| -\item |
8672 |
| -If \tcode{sizeof...(Ts)} is 2, |
8673 |
| -\tcode{\exposid{tuple-or-pair}<Ts...>} denotes \tcode{pair<Ts...>}. |
8674 |
| -\item |
8675 |
| -Otherwise, \tcode{\exposid{tuple-or-pair}<Ts...>} denotes \tcode{tuple<Ts...>}. |
8676 |
| -\end{itemize} |
8677 |
| - |
8678 | 8648 | \pnum
|
8679 | 8649 | Two \tcode{zip_view} objects have the same underlying sequence if and only if
|
8680 | 8650 | the corresponding elements of \exposid{views_} are equal\iref{concepts.equality}
|
|
0 commit comments