I am confused about copy constructors.
The class I'm writing, Person, has various member vars and methods. One of its private members is an SQL connection object (provoided by an SQL library).
My Person class will not compile:
error C2248: 'SAConnection::SAConnection' : cannot access private member declared in class 'SAConnection' <-- this is the SQL connection object
I think it is because the author of the SQL library explicitly prohibited the copy constructor. From his header file:
// disable copy constructor
SACommand(const SACommand &);
So, it seems that my Person copy constructor (generated by the compiler) is not working because it is not allowed to copy the SACommand object.
How could I get around this?
I think I need to explicitly define the Person copy constructor, but I do not know how to do this. Any tips?