Bindable CXX lambdas as methods in classes - #1952
Closed
YakoYakoYokuYoku wants to merge 1 commit into
Closed
Conversation
YakoYakoYokuYoku
force-pushed
the
std-function-method-binding
branch
from
March 21, 2026 15:14
6f0d0a6 to
040507c
Compare
Signed-off-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
YakoYakoYokuYoku
force-pushed
the
std-function-method-binding
branch
from
July 25, 2026 13:12
040507c to
d22f9dc
Compare
Collaborator
|
Personally, I don't think this is something we should merge into godot-cpp itself. One of godot-cpp's pillars is that's API compatible with Godot, and while we don't achieve that 100%, we shouldn't add new things that are incompatible. This could be provided as a third-party header-only library for folks who want this convenience and don't need module compatibility. |
Author
|
Could you wait for a sec so that I can confirm that this is doable outside the bindings? Just to put it to rest properly. |
Author
|
I've confirmed that I could do this with an external library, I'm closing this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows API users to bind lambdas as member methods in classes for the bindings, much like Python language C++ bindings such as pybind11. This is a draft implementation of this godotengine/godot-proposals#14485 proposal.
Sample usage.
See godotengine/godot#117541 for the engine implementation counterpart.