Well, i have a question about constructors. I know that the default constructor and the destructor are needed always... but how do i know if copy and conversion constructors are needed?
I have done some exercises where it said i need to make default, copy and conversion constructors and a destructor, but when i checked the solution, only the default consturctor, destructor and a constructor with all the priavte variable declared was used... no use of copy or conversion constructor...
Can anyone explain me all this a bit? Because i got a bit confused...
I know that the default constructor and the destructor are needed always..
Nope. Deafault, copy constructor and destructor are compiler generated if you didn't define them. So does assignment operator.
Rule of three: if you need to define one of following: destructor, copy constructor or assignment operator, you probably should define others too.
SO basically if i let them out, nothing is wrong if i get this right?
-and the purpose in that exercise was to just know how to write them and what they do i suppose?