I have a c++ class which as a private data member has a struct defined:
Class example {
...
private:
struct Impl;
Impl& structure_;
};
Assuming that the struct Impl is defined as follows:
struct example::Impl{
int m1;
int m2;
int m3;
};
how would I be able to initialize the struct instance ( structure_ ) in the class's constructor?
Right now I have:
example::example() :
structure_ .m1(00),
structure_ .m2(00),
structure_ .m3(00) {
...
}
.. for the initialization list, but I'm getting this error:
'example::structure_' : must be initialized in constructor base/member initializer list
how would I fix this?
Thanks