I have the following use case, a struct with some boolean and int variables
struct a {
int field1;
bool field2;
bool field3;
};
I am refactoring this code, and writing a constructor for the struct , the problem is the default initialization of fields.
I am not criticizing any language construct here, but ideally I would want null to be part of the language itself
i mean I should be able to define for struct a as
a : field1(null.int), field2(null.bool), field3(null.bool) {}
C++ does not allow it since null.int or null.bool are not defined. Is the only way to do in C++ is
a: field1(-1), field2(false), field3(false) {}