I have a struct with many members of the same type, like this
struct VariablePointers {
VariablePtr active;
VariablePtr wasactive;
VariablePtr filename;
};
And I forgot to initialize filename, instead it went like this:
VariablePointers{activePtr, filename}
How can I prevent this kind of error? I could add a constructor, but it would duplicate the list of variable twice, so I have to type all of this thrice!
Aucun commentaire:
Enregistrer un commentaire