Default values for member variables #4
Replies: 4 comments
-
Same thing with a lot of common header code, I'll post any I encounter. Virtual destructors fail too, subclassing from FRunnable, probably happens with others too:
|
Beta Was this translation helpful? Give feedback.
-
For now I've been keeping things outside of headers as much as possible, or wrapping things in |
Beta Was this translation helpful? Give feedback.
-
oh yeah, the default values parser is at the moment very simple, this one has to go through some heavy lifting, i've encountered this too in more day-to-day work. |
Beta Was this translation helpful? Give feedback.
-
Hello, it is the correct thing to set default values for member variables in UE, otherwise, when building the Shipping package in UE, any member variables that do not have default values will be random values. |
Beta Was this translation helpful? Give feedback.
-
Right now the docs cannot generate when you declare a default value on classes, struct, etc their member variables:
This is probably intentional as a design decision since it may be prudent to only rely on constructors in the .cpp to set default values, a good habit but not one many stick to. I would love to hear your thoughts about either changing the docs plugin to ignore (and at least not fail building documentation) in these cases and why specifically none of your example code (and systems architecture code) ever sets a default value in the header? Is it just a good things to do to maintain clear and well structured code?
Thank you in advance,
Wouter
Beta Was this translation helpful? Give feedback.
All reactions