2525
2626#include " ../types.h"
2727
28- struct ProxyInt {
28+ struct ProxyRef {
2929 int & val;
3030};
3131
32- class ExtraProxyInt {
32+ class CommonProxyRef {
3333public:
34- constexpr ExtraProxyInt (ProxyInt i) : val(i.val) {}
35- constexpr ExtraProxyInt (int i) : val(i) {}
34+ constexpr CommonProxyRef (ProxyRef i) : val(i.val) {}
35+ constexpr CommonProxyRef (int i) : val(i) {}
3636
3737 constexpr int get () const { return val; }
3838
@@ -41,17 +41,17 @@ class ExtraProxyInt {
4141};
4242
4343template <template <class > class TQual , template <class > class UQual >
44- struct std ::basic_common_reference<ProxyInt , int , TQual, UQual> {
45- using type = ExtraProxyInt ;
44+ struct std ::basic_common_reference<ProxyRef , int , TQual, UQual> {
45+ using type = CommonProxyRef ;
4646};
4747
4848template <template <class > class TQual , template <class > class UQual >
49- struct std ::basic_common_reference<int , ProxyInt , TQual, UQual> {
50- using type = ExtraProxyInt ;
49+ struct std ::basic_common_reference<int , ProxyRef , TQual, UQual> {
50+ using type = CommonProxyRef ;
5151};
5252
53- static_assert (std::common_reference_with<int &, ProxyInt >);
54- static_assert (std::common_reference_with<int &, ExtraProxyInt >);
53+ static_assert (std::common_reference_with<int &, ProxyRef >);
54+ static_assert (std::common_reference_with<int &, CommonProxyRef >);
5555
5656class ProxyIter {
5757public:
@@ -61,7 +61,7 @@ class ProxyIter {
6161 constexpr ProxyIter () : ptr_(nullptr ) {}
6262 constexpr explicit ProxyIter (int * p) : ptr_(p) {}
6363
64- constexpr ProxyInt operator *() const { return ProxyInt {*ptr_}; }
64+ constexpr ProxyRef operator *() const { return ProxyRef {*ptr_}; }
6565
6666 constexpr ProxyIter& operator ++() {
6767 ++ptr_;
@@ -196,21 +196,21 @@ constexpr bool test() {
196196 using Inner = std::vector<int >;
197197 using V = std::vector<Inner>;
198198 using Pattern = std::ranges::subrange<ProxyIter, ProxyIter>;
199- using JWV = std::ranges::join_with_view<std::ranges::owning_view<V>, std::ranges::owning_view< Pattern> >;
199+ using JWV = std::ranges::join_with_view<std::ranges::owning_view<V>, Pattern>;
200200
201201 static_assert (!std::same_as<std::ranges::range_reference_t <V>, std::ranges::range_reference_t <JWV>>);
202202 static_assert (!std::same_as<std::ranges::range_reference_t <Pattern>, std::ranges::range_reference_t <JWV>>);
203203
204204 std::array<int , 2 > pattern = {-1 , -1 };
205205 Pattern pattern_as_subrange (ProxyIter{pattern.data ()}, ProxyIter{pattern.data () + pattern.size ()});
206206
207- JWV jwv (V{Inner{1 , 1 }, Inner{2 , 2 }, Inner{3 , 3 }}, std::move ( pattern_as_subrange) );
207+ JWV jwv (V{Inner{1 , 1 }, Inner{2 , 2 }, Inner{3 , 3 }}, pattern_as_subrange);
208208
209- auto it = jwv.begin ();
210- std::same_as<ExtraProxyInt > decltype (auto ) v_ref = *it;
209+ auto it = jwv.begin ();
210+ std::same_as<CommonProxyRef > decltype (auto ) v_ref = *it;
211211 assert (v_ref.get () == 1 );
212212 std::ranges::advance (it, 7 );
213- std::same_as<ExtraProxyInt > decltype (auto ) pattern_ref = *std::as_const (it);
213+ std::same_as<CommonProxyRef > decltype (auto ) pattern_ref = *std::as_const (it);
214214 assert (pattern_ref.get () == -1 );
215215 }
216216
0 commit comments