It defines a class to inherit from which can't be copied (note that this version only works on C++11 and later). If I remove the default constructor/destructor definition it still compiles on it's own, but if I try to inherit from it, compilation fails.
My question is this: doesn't the compiler provide two default functions for these?
> doesn't the compiler provide two default functions for these?
There would be an implicitly-declared default constructor (if possible) if and only if there are no user-declared constructors (of any kind).
Here, NonCopiable has a user-declared deleted copy constructor; and so it would not have an implicitly-declared default constructor. The compiler would have provided an implicitly-declared (public) destructor for the class if there was no user-declared destructor.