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

Support for mutable lambdas in catch functions. #952

Merged
merged 2 commits into from
Sep 30, 2024
Merged

Conversation

kring
Copy link
Member

@kring kring commented Sep 28, 2024

I noticed while working on CesiumGS/cesium-unreal#1526 that a bug made it impossible (compiler error) to pass a mutable lambda to a catchImmediately or catchInMainThread function. Mutable lambdas are necessary when you want to std::move a captured value elsewhere, because in a non-mutable lambda (the default), all captured parameters are const.

This PR fixes it by adding the missing mutable to the wrapper lambdas.

@j9liu
Copy link
Contributor

j9liu commented Sep 30, 2024

Seems good to me, thanks @kring !

@j9liu j9liu merged commit 31e93ac into main Sep 30, 2024
24 checks passed
@j9liu j9liu deleted the mutable-catch-lambda branch September 30, 2024 14:28
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