For a class MyFancyClass { }; what default methods will the compiler generate? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

For a class MyFancyClass { }; what default methods will the compiler generate?

16th Jan 2017, 3:35 PM
Naveen Kumar
Naveen Kumar - avatar
2 Answers
0
a constructor? maybe. but you wouldnt be able to do anything with that object if you did create it. it doesnt have any member variables or functions, its basically useless...
23rd Feb 2017, 7:09 PM
Michael Szczepanski
Michael Szczepanski - avatar
0
in c++ the four followings are automatically generated by the compiler if needed and not listed in the class declaration: default constructor, copy constructor, destructor, copy assignment operator in c++11 and newer there are additional the move condtructor and move assignment operator which are automatically generated
7th May 2017, 8:59 PM
Volker Milbrandt
Volker Milbrandt - avatar