libstdc++: Implement LWG 3564 for ranges::transform_view
commitdde19c600c3c8a1d765c9b4961d2556e89edad14
authorJonathan Wakely <jwakely@redhat.com>
Sun, 13 Oct 2024 20:47:14 +0000 (13 21:47 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 14 Oct 2024 21:07:28 +0000 (14 22:07 +0100)
tree46edaa15d8c3f5635def484f7339a9101149f672
parentcacbb4daac3e9a9d86992fef1a7c607b4cee5f22
libstdc++: Implement LWG 3564 for ranges::transform_view

The _Iterator<true> type returned by begin() const uses const F& to
transform the elements, so it should use const F& to determine the
iterator's value_type and iterator_category as well.

This was accepted into the WP in July 2022.

libstdc++-v3/ChangeLog:

* include/std/ranges (transform_view:_Iterator): Use const F&
to determine value_type and iterator_category of
_Iterator<true>, as per LWG 3564.
* testsuite/std/ranges/adaptors/transform.cc: Check value_type
and iterator_category.

Reviewed-by: Patrick Palka <ppalka@redhat.com>
libstdc++-v3/include/std/ranges
libstdc++-v3/testsuite/std/ranges/adaptors/transform.cc