Skip to content

[3.x] Use if constexpr in Object::derives_from#108199

Merged
lawnjelly merged 1 commit intogodotengine:3.xfrom
Ivorforce:3x-derives-from-if-constexpr
Jul 2, 2025
Merged

[3.x] Use if constexpr in Object::derives_from#108199
lawnjelly merged 1 commit intogodotengine:3.xfrom
Ivorforce:3x-derives-from-if-constexpr

Conversation

@Ivorforce
Copy link
Copy Markdown
Member

Now that if constexpr is supported, it should be used where appropriate.
This one instance immediately came to mind.

This change should not change anything in the output binary if compilers are good, but guarantees that the if is compiled away. So it should be added.

@Ivorforce Ivorforce added this to the 3.x milestone Jul 2, 2025
@Ivorforce Ivorforce requested a review from lawnjelly July 2, 2025 11:13
@Ivorforce Ivorforce requested a review from a team as a code owner July 2, 2025 11:13
@lawnjelly lawnjelly merged commit 17b5769 into godotengine:3.x Jul 2, 2025
14 checks passed
@lawnjelly
Copy link
Copy Markdown
Member

Thanks!

@lawnjelly
Copy link
Copy Markdown
Member

Now that if constexpr is supported, it should be used where appropriate.

There's likely a whole lot of cases in templates, probably in need of a bulk PR which we can do soon.

@Ivorforce Ivorforce deleted the 3x-derives-from-if-constexpr branch July 2, 2025 11:46
@akien-mga akien-mga changed the title 3.x: Use if constexpr in Object::derives_from [3.x] Use if constexpr in Object::derives_from Oct 20, 2025
@akien-mga akien-mga modified the milestones: 3.x, 3.7 Oct 20, 2025
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.

3 participants