I was looking through the code considering how I might implement runtime configuration changes and I notice that Category does not declare a copy constructor or assignment operator. Therefore, the compiler will generate them and it further appears to me that this would not be safe at all based on the destructor.
Am I missing something or should these be declared private and left unimplemented? I have been creating Category members that have been initialized with the copy constructor and didn't know that it was unsafe until now. I had just assumed that there was a reference counting scheme.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You're absolutely right: a private copy constructor and assignment operator to prevent copying of Category are missing. I've added them now. If you see any more of these, please let me know!
I'm more used to Java where not writing code is not a crime... :-)
Cheers,
Bastiaan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was looking through the code considering how I might implement runtime configuration changes and I notice that Category does not declare a copy constructor or assignment operator. Therefore, the compiler will generate them and it further appears to me that this would not be safe at all based on the destructor.
Am I missing something or should these be declared private and left unimplemented? I have been creating Category members that have been initialized with the copy constructor and didn't know that it was unsafe until now. I had just assumed that there was a reference counting scheme.
Hi Shane,
You're absolutely right: a private copy constructor and assignment operator to prevent copying of Category are missing. I've added them now. If you see any more of these, please let me know!
I'm more used to Java where not writing code is not a crime... :-)
Cheers,
Bastiaan