I’d like to make object of class not copyable so I put copy constructor and operator= in private section. However one class is friend of this class so it has access to private methods. Is it good idea to put throw exception in copy constructor and operator= to be sure that object will not be copied?
Share
One approach to make it not copyable is just to declare the copy constructor, but don’t implement it at all. That will force a linker error at compile time if anyone tries to use it.