Re: [committed] libstdc++: Make ranges CPOs final and not addressable

2021-06-16 Thread Jonathan Wakely via Gcc-patches
On Tue, 15 Jun 2021 at 22:33, Jonathan Wakely wrote: > > On Tue, 15 Jun 2021 at 21:32, Tim Song wrote: > > > > CPOs are specified as actual semiregular function objects that can be > > copied and constructed freely, so it seems a bit hostile to make them > > final/non-addressable? (It's debatable

Re: [committed] libstdc++: Make ranges CPOs final and not addressable

2021-06-15 Thread Jonathan Wakely via Gcc-patches
On Tue, 15 Jun 2021 at 21:32, Tim Song wrote: > > CPOs are specified as actual semiregular function objects that can be > copied and constructed freely, so it seems a bit hostile to make them > final/non-addressable? (It's debatable whether the type of a CPO is a > type "specified in the C++

Re: [committed] libstdc++: Make ranges CPOs final and not addressable

2021-06-15 Thread Tim Song via Gcc-patches
CPOs are specified as actual semiregular function objects that can be copied and constructed freely, so it seems a bit hostile to make them final/non-addressable? (It's debatable whether the type of a CPO is a type "specified in the C++ standard library" for which [derivation]/4 would apply.) On

[committed] libstdc++: Make ranges CPOs final and not addressable

2021-06-15 Thread Jonathan Wakely via Gcc-patches
This restricts the API of the CPOs and other function objects so they cannot be misused by deriving from them or taking their addresses. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/ranges_base.h (ranges::begin, ranges::end) (ranges::cbegin,