From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BB5E33835439; Mon, 17 May 2021 12:32:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB5E33835439 From: "rs2740 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/100631] ranges::elements_view:: _Sentinel is missing __distance_from() that can access _M_current of _Iterator Date: Mon, 17 May 2021 12:32:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rs2740 at gmail dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2021 12:32:10 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100631 TC changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rs2740 at gmail dot com --- Comment #4 from TC --- (In reply to =E5=BA=B7=E6=A1=93=E7=91=8B from comment #1) > Another issue is that in elements_view::_Sentinel in ranges#L3677: >=20 >=20 > template typename _Base2 =3D __detail::__maybe_const_t<_Const2, _Vp>> > requires sized_sentinel_for, iterator_t<_Base2>> > friend constexpr range_difference_t<_Base2> > operator-(const _Iterator<_Const2>& __x, const _Sentinel& __y) > { return __x._M_current - __y._M_end; } >=20 >=20 > the return type of the function is range_difference_t<_Base2>, but in > [range.elements#sentinel], it is defined as range_difference_t: >=20 >=20 > template > requires sized_=C2=ADsentinel_=C2=ADfor, iterator_t<= maybe-=20 > const>> > friend constexpr range_difference_t > operator-(const iterator& x, const sentinel& y); >=20 >=20 > Perhaps range_difference_t and range_difference_t<_Base2> are > equivalent in this case, but I am not sure. This one is a problem with the WP.=