libstdc++: Implement P2540R1 change to views::cartesian_product()
commit98966f32f906303cd7d2e1c418f320c483e6dcbe
authorPatrick Palka <ppalka@redhat.com>
Wed, 17 Jan 2024 02:20:12 +0000 (16 21:20 -0500)
committerPatrick Palka <ppalka@redhat.com>
Wed, 17 Jan 2024 02:20:12 +0000 (16 21:20 -0500)
tree809104721709d915e6696caa9a46a622534a4dd9
parent1a17797496f72982c1c802725704a9aaf01218b5
libstdc++: Implement P2540R1 change to views::cartesian_product()

This paper changes the identity element of views::cartesian_product to a
singleton range instead of an empty range.  It was approved alongside
the main cartesian_product paper P2374R4, but unfortunately was overlooked
when implementing the main paper.

libstdc++-v3/ChangeLog:

* include/std/ranges (views::_CartesianProduct::operator()):
Adjust identity case as per P2540R1.
* testsuite/std/ranges/cartesian_product/1.cc (test01):
Adjust expected result of the identity case.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/include/std/ranges
libstdc++-v3/testsuite/std/ranges/cartesian_product/1.cc