Skip to content

[stdlib] Workaround C++ lifetime rules #35339

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

Closed
wants to merge 1 commit into from

Conversation

davezarzycki
Copy link
Contributor

@davezarzycki davezarzycki requested a review from mikeash January 10, 2021 12:10
@davezarzycki
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@mikeash mikeash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks again.

@davezarzycki
Copy link
Contributor Author

(Thinking out loud.) I wonder if we ought to just have a forEach method on the concurrent collection that internally snapshots rather than expose the snapshot method? Otherwise all of the callers need to know about the C++ lifetime wart. What do you think?

@mikeash
Copy link
Contributor

mikeash commented Jan 10, 2021

There’s a way to make the methods on the snapshot not callable on a temporary. I’m going to try that out tomorrow. If that ends up being unworkable, some sort of callback-based API would be a good plan B.

@davezarzycki
Copy link
Contributor Author

@mikeash – We can close this now because of #35345 right?

@mikeash
Copy link
Contributor

mikeash commented Jan 11, 2021

Yeah, this isn't actually needed after all.

@davezarzycki davezarzycki deleted the pr35339 branch January 11, 2021 16:34
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.

2 participants