C++ compiler in certain conditions for class adds implicit default constructor, copy constructor, destructor, conversion operators, assignment operators, etc. And other implicit methods.
How do I disable/delete all possible implicit methods in shortest way possible?
I don't want my class to be un-copyable, I want just these default methods to be disabled so that compiler throws compile error and I implement them by myself. I just want to have over-control, so that compiler doesn't do any silent work about my class.
For example I can do next thing (this is just a dummy example, in real life I can have any complex class):
class C {
private:
C() = delete;
C(C const & other) = delete;
C & operator = (C const & other) = delete;
};
But this is long way, also I can forget deleting some of methods signatures and I need to delete all of them. So that I reimplement all methods from scratch by myself.
And I need to see errors for all methods that other code needs/uses and that I have not yet implemented, instead of compiler silently implementing those methods for me.
Also if I delete default methods like I did above in my example, how can I be sure that there are no other silently created methods? Is there online a list of 100% all standard methods created silently by compiler?