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

Avoid extra std::function layer in func::make #546

Merged
merged 2 commits into from
Jan 10, 2025
Merged

Conversation

dsharlet
Copy link
Owner

For the lambda version of func::make, we currently get two layers of std::function: one for call_stmt::callable, which is unavoidable, but the other is just a wrapper to change the arguments, and doesn't need to be an std::function, which adds some extra overhead.

This PR avoids the inner std::function, calling the lambda directly instead.

@dsharlet dsharlet merged commit 32fbea5 into main Jan 10, 2025
1 check passed
@dsharlet dsharlet deleted the ds/call-lambda branch January 10, 2025 17:09
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