I want to know if in the case of there are no user defined default constructors will the compiler generate default constructor in all situations. If there are situations in which compiler would not create default constructor let me know about it
Printable View
I want to know if in the case of there are no user defined default constructors will the compiler generate default constructor in all situations. If there are situations in which compiler would not create default constructor let me know about it
No there are situations in which default constructors would not be created. One of which I am aware of is if the class has constant type members say constant private members then compiler would not create default constructors for these and error would result if there is no user defined constructors defined for these.