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

Make Coroutine constructors' generic type arguments require 'static #36

Merged
merged 1 commit into from
Oct 6, 2024

Conversation

zetanumbers
Copy link
Contributor

Solves #27 once and for all (most likely).

@Amanieu
Copy link
Owner

Amanieu commented Oct 5, 2024

I think this also needs to be done for on_stack.

@zetanumbers
Copy link
Contributor Author

I think this also needs to be done for on_stack.

I see no reason for this. The original issue was caused by violating std::thread::scope's assumption about references staying valid at least until function return. This in turn is caused by yielding from a function including from std::thread::scope's input closure, and then forgetting a coroutine would allow to invalidate such reference.

@loongs-zhang
Copy link
Contributor

I think this also needs to be done for on_stack.

I see no reason for this. The original issue was caused by violating std::thread::scope's assumption about references staying valid at least until function return. This in turn is caused by yielding from a function including from std::thread::scope's input closure, and then forgetting a coroutine would allow to invalidate such reference.

The on_stack maybe used in coroutine.

@Amanieu Amanieu merged commit 8f9a489 into Amanieu:master Oct 6, 2024
24 checks passed
@zetanumbers zetanumbers deleted the static-type-args branch October 6, 2024 10:02
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