nullptr
initialization of pointer member variables in class definition
#223
Labels
nullptr
initialization of pointer member variables in class definition
#223
Currently, mgmol classes do not initialize pointer member variables in their class definitions. For example of
MGMol<OrbitalsType>
,This is very error-prone and hard to debug, as they have uninitialized pointers which exhibit unexpected behaviors. This practice should be changed as soon as possible, as below:
This is usually the safest and shortest initialization. An alternative is to define them as
nullptr
in the constructor (For example,MGmol<OrbitalsType>::MGmol(...)
).The text was updated successfully, but these errors were encountered: