mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
Resolves LWG4096, views::iota(views::iota(0)) should be rejected. For __e of type _Tp that is specialization of iota_view, the CTAD based expression iota_view(__e) is well formed, and creates a copy of __e. As iota_view<decay_t<_Tp>> is ill-formed in this case (iota_view is not weakly_incrementable), using that type in return type explicitly, removes the overload from overload resolution in this case. The (now redudant) __detail::__can_iota_view constrain in template head is preserved, to provide error messages consistent with adaptors for other non-incrementable types. libstdc++-v3/ChangeLog: * include/std/ranges (_Iota::operator()(_Tp&&)): Replace auto return type and CTAD with iota_view<decay_t<_Tp>>. * testsuite/std/ranges/iota/iota_view.cc: Tests if views::iota(iota_view) is rejected. Reviewed-by: Jonathan Wakely <jwakely@redhat.com> Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
file: libstdc++-v3/README New users may wish to point their web browsers to the file index.html in the 'doc/html' subdirectory. It contains brief building instructions and notes on how to configure the library in interesting ways.