]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Make views::single/iota/istream SFINAE-friendly [PR108362]
authorPatrick Palka <ppalka@redhat.com>
Thu, 9 Mar 2023 18:35:04 +0000 (13:35 -0500)
committerPatrick Palka <ppalka@redhat.com>
Sat, 29 Apr 2023 13:46:06 +0000 (09:46 -0400)
commit7d0cddced0ff101f5f59ceb2a45e7f145ff973ac
treeb50af43c88b406ecbf3a787058f8f518354e69d4
parent1539af7fe0d77e8b56cb58bd757c304833b3bac3
libstdc++: Make views::single/iota/istream SFINAE-friendly [PR108362]

PR libstdc++/108362

libstdc++-v3/ChangeLog:

* include/std/ranges (__detail::__can_single_view): New concept.
(_Single::operator()): Constrain it.  Move [[nodiscard]] to the
end of the function declarator.
(__detail::__can_iota_view): New concept.
(_Iota::operator()): Constrain it.  Move [[nodiscard]] to the
end of the function declarator.
(__detail::__can_istream_view): New concept.
(_Istream::operator()): Constrain it.  Move [[nodiscard]] to the
end of the function declarator.
* testsuite/std/ranges/iota/lwg3292_neg.cc: Prune "in
requirements" diagnostic.
* testsuite/std/ranges/iota/iota_view.cc (test07): New test.
* testsuite/std/ranges/istream_view.cc (test08): New test.
* testsuite/std/ranges/single_view.cc (test07): New test.

(cherry picked from commit 95827e1b9f7d5dd5a697bd60292e3876a7e8c15c)
libstdc++-v3/include/std/ranges
libstdc++-v3/testsuite/std/ranges/iota/iota_view.cc
libstdc++-v3/testsuite/std/ranges/iota/lwg3292_neg.cc
libstdc++-v3/testsuite/std/ranges/istream_view.cc
libstdc++-v3/testsuite/std/ranges/single_view.cc