KEMBAR78
P2502R2 `<generator>`: Synchronous Coroutine Generator For Ranges by CaseyCarter · Pull Request #4953 · microsoft/STL · GitHub
Skip to content

Conversation

@CaseyCarter
Copy link
Contributor

@CaseyCarter CaseyCarter commented Sep 13, 2024

This is the 44 commits from feature/generator plus one more to add a forward in a test_one overload in P2502R2_generator.
I've verified that we implement the resolutions of the three LWG issues mentioned in #2936, and recently validated that we address all the "add a new header requirements".

Closes #2936, fixes #4952 (comment).

I stuffed all the implementation details in <generator> into namespace _Gen_detail, and simplified names that no longer need disambiguation. The delta looks huge, but the largest commit (b61b7ba) is mostly just additional indentation, and the remainder are a single rename each.

CaseyCarter and others added 30 commits January 25, 2024 21:14
Resolved conflict in yvals_core.h, removing all guards around `__cpp_lib_generator` except `_HAS_CXX23`.

* `__cpp_lib_concepts` is now always available in C++20 and later.
* `<generator>` doesn't care about `std::byte` now.
* C1XX, Clang, and EDG all define `__cpp_impl_coroutine` in C++20 and later, which wasn't the case earlier.
Also add a missing semicolon - this emits a `_Pragma`.
VSO-1951821 "EDG instantiates the wrong overload of `promise_type::operator new` for `generator` machinery"
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Resolved a trivial merge conflict in `<ranges>` with the `inline constexpr` change for `_Compile_time_max_size`.
Co-authored-by: Casey Carter <cacarter@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Alex Guteniev <gutenev@gmail.com>
@StephanTLavavej

This comment was marked as resolved.

* `const`-ify members of awaitable objects that can be `const`.
* Annotate that the iterator's `operator*` has a `/* strengthened */` _noexcept-specifier_.
@StephanTLavavej

This comment was marked as resolved.

Several minor nits, and I burned away all the unnecessary parts of "mutable rvalue reference type". Don't know where I was heading with it, but it never made it there.
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej
Copy link
Member

I had to push an additional commit to work around VSO-2254804 "EDG ICE in cpfe.dll!make_coroutine_result_expression with C++23 <generator> test" (an internal assertion, which is why we didn't see it with shipping EDG). I checked how much code I could enable without ICEing, and it turned out that the regions we need to workaround are exactly the same as for Clang x86.

@CaseyCarter
Copy link
Contributor Author

... it turned out that the regions we need to workaround are exactly the same as for Clang x86.

I suspect this is related to the confusion about coroutines and x86 MSABI discussed in LLVM-59382.

@StephanTLavavej StephanTLavavej merged commit 192e861 into microsoft:main Sep 19, 2024
39 checks passed
@CaseyCarter CaseyCarter deleted the generator-2-judgement-day branch September 19, 2024 20:56
@StephanTLavavej
Copy link
Member

⚡ 🚀 😻

Thank you @CaseyCarter, @AlexGuteniev, @cpplearner, @frederick-vs-ja, and @JMazurkiewicz for working together to land this major C++23 feature!

@SuperWig
Copy link
Contributor

uxctJP.gif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cxx23 C++23 feature generator C++23 generator

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

P2502R2 <generator>: Synchronous Coroutine Generator For Ranges

6 participants