假设以下构造函数:
class Needed
{
public:
Needed () {}
Needed (const char *name) {}
};
class Dummy
{
public:
Dummy (): needed ( "Jimmy" ) {}
private:
Needed needed;
};
那么,我在这里两次初始化了
needed
吗? 最佳答案
不,您只能在 Member Initializer List 中初始化一次。