Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Works towards #40.
Now that Victor Tong has implemented symmetric coroutine transfer for VS 2019 16.8 Preview 3 (Microsoft-internal MSVC-PR-267685), we can activate the library's feature-test macro.
Because Clang and EDG don't define
__cpp_impl_coroutine
yet, I'm structuring this in a cautious way. If we're in C++20 mode, and the compiler defines__cpp_impl_coroutine
(true for MSVC right now), we'll inspect the value - if it's the Standard value (or newer, just in case), we'll define the library macro to the Standard value (which happens to be the same). If it's a pre-Standard value (true for MSVC as of VS 2019 16.8 Preview 1 right now, will probably be true until VS 2019 16.8 Preview 4), we'll define the library macro to the pre-Standard value of Nulluary 1970.I'm updating the feature-test macro test accordingly. This adaptive behavior should allow the tests to continue passing as the compilers light up their impl macros. Adaptive behavior has been problematic in the past when we use a feature-test macro internally to activate code, but here it is precisely targeted at the
<coroutine>
header which is currently a pure leaf.I'm also removing the "partially implemented" comment, since we've merged noop coroutines. However, #40 will remain open until we add end-to-end test coverage for MSVC. (At that time we'll probably spin off separate issues for the remaining checkboxes.)