このコードを持ってみましょう
class Foo {
Foo(int) { }
};
次に、結果があります。
int main() {
Foo f1 = Foo(5); // 1: OK, explicit call
Foo f2(5); // 2: OK, implicit call
Foo f3(); // 3: no error, "f3 is a non-class type Foo()", how so?
Foo f4(f1); // 4: OK, implicit call to default copy constructor
Foo f5; // 5: expected error: empty constructor missing
}
ケース3で何が起こっているのか説明できますか?