assuming the class is not using dynamic memory
manager::manager(const manager & m)
*this = m;
Last edited on
That depends on your copy assignment operator.
I am using the default in this program. I am not using dynamic memory allocation.
It is simpler to write
manager( const manager & ) = default;
So does both work? And both do the identical thing? thank you :)
In many cases the copy constructor will be generated automatically so you might not need the line vlad posted.