diff --git a/ch7/7.46.md b/ch7/7.46.md index 914a28e..547f662 100644 --- a/ch7/7.46.md +++ b/ch7/7.46.md @@ -1,6 +1,24 @@ (a) A class must provide at least one constructor. - True. If the programmer doesn't provide any constructor, the compiler will synthesise one default constructor. + False. + This is valid code: + ``` + #include + + class C { + public: + C() = delete; + static int a; + }; + + int C::a = 1; + + int main() { + std::cout << C::a << std::endl; + return 0; + } + ``` + (b) A default constructor is a constructor with an empty parameter list.