S
Scott
Hi All,
I have two classes like so:
class A
{
// ...stuff
};
class B
{
public:
B() {}
private:
A a;
};
How can I specify that B should initialize a with A's default constructor
in its own initialization list. For example, do I write:
class B
{
public:
B() : a(a()) {}
// ..etc
or just,
B() : a() {}
or is there some other way?
Thanks for any assistance!
Best,
Scott
I have two classes like so:
class A
{
// ...stuff
};
class B
{
public:
B() {}
private:
A a;
};
How can I specify that B should initialize a with A's default constructor
in its own initialization list. For example, do I write:
class B
{
public:
B() : a(a()) {}
// ..etc
or just,
B() : a() {}
or is there some other way?
Thanks for any assistance!
Best,
Scott