O
Oliver
hi, all -
I have a newbie question: suppose I have a user-defined class that must take a argument to properly initialize. so I have something like:
class Foo {
explicit Foo(const string &str);
....
}
Another class define Foo as its member:
class Bar {
private:
Foo foo;
}
Now the compiler complains that it can find the candidate constructor. So it seems I must define a no-argument constructor for Foo ... at the risk of the object can exist without being properly initialized? I must have missed something ...
Thanks for your help
Oliver
I have a newbie question: suppose I have a user-defined class that must take a argument to properly initialize. so I have something like:
class Foo {
explicit Foo(const string &str);
....
}
Another class define Foo as its member:
class Bar {
private:
Foo foo;
}
Now the compiler complains that it can find the candidate constructor. So it seems I must define a no-argument constructor for Foo ... at the risk of the object can exist without being properly initialized? I must have missed something ...
Thanks for your help
Oliver