Hi all, I have few basic questions here. Consider the following class :
class Test {
int a;
}
What is auto generated here by the compiler ?
I think it's the default constructor and the default destructor.
And are some default copy constructor and assignment operator generated also, or we'll have to declare them explicitly ?
Another question, if we define our own constructor, there will be no default constructor generated by the compiler, am I right ?
Thank you
p.p.:
My opinion is that there is auto generated default constructor, destructor and assignment operator, but only if there are no explicitly defined such. I want to know am I right here. :)
So I understand that there will be a copy constructor generated after all. And assignment operator.
And I guess of course default constructor (with no arguments) and destructor also :
OurClass(&AnotherClass instance); // copy constructor
OurClass(); // default constructor
~OurClass(); // default destructor
// and also assignment operator here