|
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) {
|
8603 |
| - return @\exposid{tuple-or-pair}@<invoke_result_t<F&, Ts>...>( |
| 8584 | + return tuple<invoke_result_t<F&, Ts>...>( |
8604 | 8585 | invoke(f, std::forward<Ts>(elements))...
|
8605 | 8586 | );
|
8606 | 8587 | }, std::forward<Tuple>(tuple));
|
|
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}
|
|
8731 | 8701 | requires (@\libconcept{view}@<Views> && ...) && (sizeof...(Views) > 0)
|
8732 | 8702 | template<bool Const>
|
8733 | 8703 | class zip_view<Views...>::@\exposid{iterator}@ {
|
8734 |
| - @\exposid{tuple-or-pair}@<iterator_t<@\exposidnc{maybe-const}@<Const, Views>>...> @\exposid{current_}@;@\itcorr[-1]@ // \expos |
8735 |
| - constexpr explicit @\exposidnc{iterator}@(@\exposid{tuple-or-pair}@<iterator_t<@\exposidnc{maybe-const}@<Const, Views>>...>); |
| 8704 | + tuple<iterator_t<@\exposidnc{maybe-const}@<Const, Views>>...> @\exposid{current_}@;@\itcorr[-1]@ // \expos |
| 8705 | + constexpr explicit @\exposidnc{iterator}@(tuple<iterator_t<@\exposidnc{maybe-const}@<Const, Views>>...>); |
8736 | 8706 | // \expos
|
8737 | 8707 | public:
|
8738 | 8708 | using iterator_category = input_iterator_tag; // not always present
|
8739 | 8709 | using iterator_concept = @\seebelow@;
|
8740 |
| - using value_type = @\exposid{tuple-or-pair}@<range_value_t<@\exposid{maybe-const}@<Const, Views>>...>; |
| 8710 | + using value_type = tuple<range_value_t<@\exposid{maybe-const}@<Const, Views>>...>; |
8741 | 8711 | using difference_type = common_type_t<range_difference_t<@\exposid{maybe-const}@<Const, Views>>...>;
|
8742 | 8712 |
|
8743 | 8713 | @\exposid{iterator}@() = default;
|
|
8813 | 8783 | the iterator acquires a singular value.
|
8814 | 8784 |
|
8815 | 8785 | \begin{itemdecl}
|
8816 |
| -constexpr explicit @\exposid{iterator}@(@\exposid{tuple-or-pair}@<iterator_t<@\exposid{maybe-const}@<Const, Views>>...> current); |
| 8786 | +constexpr explicit @\exposid{iterator}@(tuple<iterator_t<@\exposid{maybe-const}@<Const, Views>>...> current); |
8817 | 8787 | \end{itemdecl}
|
8818 | 8788 |
|
8819 | 8789 | \begin{itemdescr}
|
|
9104 | 9074 | requires (@\libconcept{view}@<Views> && ...) && (sizeof...(Views) > 0)
|
9105 | 9075 | template<bool Const>
|
9106 | 9076 | class zip_view<Views...>::@\exposid{sentinel}@ {
|
9107 |
| - @\exposid{tuple-or-pair}@<sentinel_t<@\exposidnc{maybe-const}@<Const, Views>>...> @\exposid{end_}@;@\itcorr[-1]@ // \expos |
9108 |
| - constexpr explicit @\exposidnc{sentinel}@(@\exposid{tuple-or-pair}@<sentinel_t<@\exposidnc{maybe-const}@<Const, Views>>...> end); |
| 9077 | + tuple<sentinel_t<@\exposidnc{maybe-const}@<Const, Views>>...> @\exposid{end_}@;@\itcorr[-1]@ // \expos |
| 9078 | + constexpr explicit @\exposidnc{sentinel}@(tuple<sentinel_t<@\exposidnc{maybe-const}@<Const, Views>>...> end); |
9109 | 9079 | // \expos
|
9110 | 9080 | public:
|
9111 | 9081 | @\exposid{sentinel}@() = default;
|
|
9134 | 9104 | \end{codeblock}
|
9135 | 9105 |
|
9136 | 9106 | \begin{itemdecl}
|
9137 |
| -constexpr explicit @\exposid{sentinel}@(@\exposid{tuple-or-pair}@<sentinel_t<@\exposid{maybe-const}@<Const, Views>>...> end); |
| 9107 | +constexpr explicit @\exposid{sentinel}@(tuple<sentinel_t<@\exposid{maybe-const}@<Const, Views>>...> end); |
9138 | 9108 | \end{itemdecl}
|
9139 | 9109 |
|
9140 | 9110 | \begin{itemdescr}
|
|
9879 | 9849 | public:
|
9880 | 9850 | using iterator_category = input_iterator_tag;
|
9881 | 9851 | using iterator_concept = @\seebelow@;
|
9882 |
| - using value_type = @\exposid{tuple-or-pair}@<@\exposid{REPEAT}@(range_value_t<@\exposid{Base}@>, N)...>; |
| 9852 | + using value_type = tuple<@\exposid{REPEAT}@(range_value_t<@\exposid{Base}@>, N)...>; |
9883 | 9853 | using difference_type = range_difference_t<@\exposid{Base}@>;
|
9884 | 9854 |
|
9885 | 9855 | @\exposid{iterator}@() = default;
|
|
0 commit comments