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

Core: Use <type_traits> where applicable #90540

Merged

Conversation

Repiteo
Copy link
Contributor

@Repiteo Repiteo commented Apr 11, 2024

Instead of utilizing alternative implementations for metaprogramming types, this PR instead makes type_info.h include <type_traits> instead. The only other file that was using type_info.h functions was already including <type_traits>, so that takes care of an existing reduncancy. GetTypeInfo for Objects was able to be simplified to a single template, as the is_base_of_v conditional handles const conversion automatically.

Granted, I really like the idea of having a custom, trimmed-down version of <type_traits> for our own use, similar to our trimmed down String vs std::string. Though, that's better suited as a dedicated file imo. I'll probably look into a version of that sometime soon; but, for now, uniformly utilizing <type_traits> is the way to go.

Copy link
Member

@RandomShaper RandomShaper left a comment

Choose a reason for hiding this comment

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

I support this.

In fact, I have been working on #91104 and this has made me want to finish it.

@akien-mga akien-mga modified the milestones: 4.x, 4.3 Apr 24, 2024
@akien-mga akien-mga merged commit 2e92fb0 into godotengine:master Apr 24, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@Repiteo Repiteo deleted the core/type-info-use-type-traits branch April 24, 2024 17:03
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.

4 participants