You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm concerned about the use of Multiple Inheritance with class OpenXRExtensionWrapperExtension : public Object, OpenXRExtensionWrapper given that OpenXRExtensionWrapper has member variables
one of the principles I've usually followed is to avoid MI in c++ unless all but the first parent have no members
In this case, OpenXRExtensionWrapper defines
it's such a small amount of data that I think these belong in each of the child classes, and those should be the ones to implement the get_request_extensions() function and the constructor
That way, OpenXRExtensionWrapper can be a class with only virtual functions. perhaps get_request_extensions() can be declared pure virtual so implementers are forced to store the request_extensions
Godot version
v4.0.beta7
System information
All
Issue description
I'm concerned about the use of Multiple Inheritance with
class OpenXRExtensionWrapperExtension : public Object, OpenXRExtensionWrapper
given thatOpenXRExtensionWrapper
has member variablesone of the principles I've usually followed is to avoid MI in c++ unless all but the first parent have no members
In this case,
OpenXRExtensionWrapper
definesit's such a small amount of data that I think these belong in each of the child classes, and those should be the ones to implement the
get_request_extensions()
function and the constructorThat way,
OpenXRExtensionWrapper
can be a class with only virtual functions. perhapsget_request_extensions()
can be declared pure virtual so implementers are forced to store therequest_extensions
Originally posted by @lyuma in #68259 (comment)
Steps to reproduce
Code quality issue. Look for classes which have multiple inheritance (
class.*:.*,
)Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: