I believe that creating a class that is not copyable helps me with my code quality. I initially did this with boost :: noncopyable, but I found that VC ++ compiler errors are not as useful as with private members (double-clicking leads to the wrong place in the code).
T(T const&); T& operator=(T const&);
In fact, he warned me that in several cases the classes were not passed as references where they should have been. So much so that I would very much like to get a warning even about classes that I just need to copy the construct.
Is there a good way to do this? I was thinking, for example, about leaving the two methods private above and adding the public constructor T (T const &, bool dummy) to call when I really want to copy the construct. Or, alternatively, make the above two methods publicly available and somehow activate the compiler warning when creating the copy, suppressing the warning in which I want.
Or maybe all together is better?
Cookie
source share