In C++11, I have a struct here:
header:
Code:
typedef struct {
int i = 0;
int g = 0;
//to be compatible with vector.size() return data type
unsigned long int leftoff = 0;
char *path = nullptr; <-- I'm assuming that is right instead of NULL.
//holds file names
std::vector<std::string> dfile; <-- I have no idea how to initialize that
}options;
extern options opts;
Quote:
/media/data/projects/VSC/C++/codeblocks/mh5000/mh5000/options.h|21|warning: 'options::dfile' should be initialized in the member initialization list [-Weffc++]|
|
I got most of the list initialization (since C++11) thing figured out (kind of) except for that vector<string>, but I too am getting what that title says here in the cpp. it is not saying anything about my other struct set up the same with a lot more data in it, not yet anyways.
in the options.cpp it references this-> note: synthesized method 'options:: options()' first required here. (no space between the colons, I get a 'O' face if I keep it like that. )
options:: options() <--- it is not a class it is a strut, don't let that little bit of knowledge fool you about my limited amount on this subject.