Skip to content

Fix misunderstandings in GDREGISTER_CLASS (T) - #1427

Closed
pupil1337 wants to merge 4 commits into
godotengine:masterfrom
pupil1337:master
Closed

pupil1337 wants to merge 4 commits into
godotengine:masterfrom
pupil1337:master

Conversation

@pupil1337

Copy link
Copy Markdown
Contributor

to Fix #1425
When I want to register a non abstract class, I will use GDREGISTER_CLASS() or other macros, But I registered the abstract class through GDREGISTER_CLASS() (possibly because forgot to implement the pure virtual methods), and there were no compilation errors, which would give me some misunderstandings.

It is because if constexpr (!std::is_abstract_v<T>) determined that this class is an abstract class and did not compile memnew(T).

May necessary to confirm that when using GDREGISTER_CLASS(), the memnew(T) must compile. Therefore, when I mistakenly register an abstract class by GDREGISTER_CLASS(), the compiler will give error message.

@pupil1337
pupil1337 requested a review from a team as a code owner March 30, 2024 09:09
@AThousandShips AThousandShips added enhancement This is an enhancement on the current functionality discussion topic:buildsystem Related to the buildsystem or CI setup labels Mar 30, 2024
@AThousandShips AThousandShips added this to the 4.x milestone Mar 30, 2024
@pupil1337

Copy link
Copy Markdown
Contributor Author

This PR has been messed up by multiple commits, and the branch is also my master branch. I plan to delete this PR and create a new branch for this modification

@pupil1337
pupil1337 marked this pull request as draft April 7, 2024 03:45
@pupil1337 pupil1337 closed this Apr 7, 2024
@AThousandShips AThousandShips removed this from the 4.x milestone Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

archived discussion enhancement This is an enhancement on the current functionality topic:buildsystem Related to the buildsystem or CI setup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When register a Abstract Class using GDREGISTER_CLASS(), compiled without error

2 participants