Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P2770R0 "Stashing stashing iterators for proper flattening" breaks test/view/tokenize.cpp #1771

Open
StephanTLavavej opened this issue Mar 2, 2023 · 1 comment

Comments

@StephanTLavavej
Copy link

While testing @cpplearner's implementation of C++23 P2770R0 "Stashing stashing iterators for proper flattening" in microsoft/STL#3466 , we found that this breaks a range-v3 test. These lines now emit errors:

CPP_assert(forward_range<decltype(rng)>);

CPP_assert(forward_range<decltype(crng)>);

tokenize.cpp(25): error C2338: static_assert failed: 'Concept assertion failed : forward_range<decltype(rng)>'
tokenize.cpp(30): error C2338: static_assert failed: 'Concept assertion failed : forward_range<decltype(crng)>'

I believe that this is because P2770R0 marks regex_iterator and regex_token_iterator with using iterator_concept = input_iterator_tag;.

I'm working around this breaking change by updating these lines to check for only input_range, but perhaps there's a better solution.

@brevzin
Copy link
Collaborator

brevzin commented Mar 3, 2023

Hey @StephanTLavavej, thanks for the issue! If simply checking that the range is input-only rather than forward is sufficient (and the actual test that checks the content passes), then that's probably the right fix.

After all, these were always input-only to begin with - just misnamed.

No feature test macro for that paper, so I guess the test needs to just check that the resulting iterator matches regex's category.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants