私は次のようなコードをいくつか見直してきました:
class A; // defined somewhere else, has both default constructor and A(int _int) defined
class B
{
public:
B(); // empty
A a;
};
int main()
{
B* b;
b = new B();
b->a(myInt); // here, calling the A(int _int) constructor,
//but default constructor should already have been called
}
これは機能しますか?デフォルトが既に呼び出された後に特定のコンストラクターを呼び出す?