Skip to content

Conversation

@chghehe
Copy link
Contributor

@chghehe chghehe commented Mar 25, 2025

Added support for coroutines like std::generator which cannot used with co_await, but might be iterated as a range.

#339

@codecov
Copy link

codecov bot commented Mar 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.41%. Comparing base (eaeb89c) to head (7993b1b).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #344   +/-   ##
=======================================
  Coverage   99.40%   99.41%           
=======================================
  Files          15       15           
  Lines        1344     1361   +17     
  Branches       21       22    +1     
=======================================
+ Hits         1336     1353   +17     
  Misses          8        8           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rollbear
Copy link
Owner

Oh, it was that simple. I went in the completely wrong direction and made things very complicated for myself. Thank you.

I'll see if I can figure out what is causing problems with MSVC.

@rollbear
Copy link
Owner

Grr. MSVC says 199711 for __cplusplus, even when compiling with /std:c++20. See https://godbolt.org/z/3MroGTe18

However, it does correctly set __cpp_impl_coroutine, and so do the other compilers, so your PR seems works fine if I remove the check for C++20. Was there a specific reason you added this, or can I merge with the check removed?

@chghehe
Copy link
Contributor Author

chghehe commented Mar 30, 2025

That is well known microsoft "feature" and might be solved by adding /Zc:__cplusplus compile option.
I use ranges in that header, that is why I added the check. If you think that is not necessary, feel free to remove it.

@chghehe
Copy link
Contributor Author

chghehe commented Mar 30, 2025

Also, I tried to use macro __cpp_lib_ranges but it is defined in <version> which is available only since c++20 :)

@chghehe
Copy link
Contributor Author

chghehe commented Mar 30, 2025

Probably, this check shall be refined with _MSC_VER and _MSC_LANG macros for MSVC... Or completely removed.

@rollbear
Copy link
Owner

Just merged it. For some reason GitHub didn't recognize this as accepting your PR, so I'm closing it. The changes are in main now, though.

@rollbear rollbear closed this Mar 30, 2025
@RedBeard0531
Copy link

@rollbear, would you mind cutting a release soon with this? If you could also squeeze in #351, that would be lovely 😄

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

Successfully merging this pull request may close these issues.

3 participants