| 1 | // { dg-do run { target c++23 } } |
| 2 | |
| 3 | // Verify LWG 3715 changes. |
| 4 | |
| 5 | #include <ranges> |
| 6 | #include <sstream> |
| 7 | #include <testsuite_hooks.h> |
| 8 | |
| 9 | void |
| 10 | test01() |
| 11 | { |
| 12 | std::istringstream ints("0 1 2 3 4"); |
| 13 | auto i = std::views::istream<int>(ints); |
| 14 | auto r4 = std::views::counted(i.begin(), 4) | std::views::chunk(2); |
| 15 | VERIFY( !r4.empty() ); |
| 16 | } |
| 17 | |
| 18 | void |
| 19 | test02() |
| 20 | { |
| 21 | std::istringstream ints("0 1 2 3 4"); |
| 22 | auto i = std::views::istream<int>(ints); |
| 23 | auto r0 = std::views::counted(i.begin(), 0) | std::views::chunk(2); |
| 24 | VERIFY( r0.empty() ); |
| 25 | } |
| 26 | |
| 27 | int |
| 28 | main() |
| 29 | { |
| 30 | test01(); |
| 31 | test02(); |
| 32 | } |