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 Object::to_string virtual #42093

Merged
merged 1 commit into from
Sep 15, 2020
Merged

Make Object::to_string virtual #42093

merged 1 commit into from
Sep 15, 2020

Conversation

Xrayez
Copy link
Contributor

@Xrayez Xrayez commented Sep 15, 2020

Allows to override printing via C++, not only via script. Useful for implementing pretty-printing for core data structures in C++ modules. See concrete use case at goostengine/goost#12.

Recommended usage for overriding:

virtual String to_string() override;

But if you want to make the changes compatible in previous versions of Godot, just omit override keyword:

virtual String to_string();

Allows to override printing via C++, not only via script.
@akien-mga akien-mga added this to the 4.0 milestone Sep 15, 2020
@akien-mga akien-mga merged commit 7f0352b into godotengine:master Sep 15, 2020
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Sep 15, 2020
@Xrayez Xrayez deleted the virtual-to_string branch September 15, 2020 16:05
@akien-mga
Copy link
Member

Cherry-picked for 3.2.4.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants