[PATCH] libstdc++: Add missing friend declarations in some range adaptors
Jonathan Wakely
jwakely@redhat.com
Thu Feb 27 17:25:00 GMT 2020
On 27/02/20 11:27 -0500, Patrick Palka wrote:
>Some of the range adaptors have distinct constant and non-constant
>iterator/sentinel types, along with converting constructors that can convert a
>non-constant iterator/sentinel to a constant iterator/sentinel. This patch adds
>the missing appropriate friend declarations in order to make these converting
>constructors well formed.
>
>Strictly speaking it seems the friendship relation doesn't need to go both ways
>-- we could get away with declaring e.g. friend _Iterator<false>; instead of
>friend _Iterator<!_Const>; but the spec and the reference implementations all
>seem to use the latter symmetric form anyway.
I think at least one of those friend declarations in the spec was
recently removed, because the class it was in is presented for
exposition only, so doesn't actually need to declare other
non-existent classes as friends. But it's certainly not a problem to
use _Iterator<!_Const> rather than _Iterator<false>.
OK for master, thanks.
More information about the Libstdc++
mailing list