Multiple default choices
Deleting the default constructor of a class is a good idea when there are multiple choices for the default or uninitialised state. For example, suppose I have a class,
template<typename F>
class Polynomial;
which represents a polynomial over a field, F
. In this case, there are many choices for a default value of the polynomial. One could be the identity for polynomials under addition, i.e. zero, but we could also have the multiplicative identity, unity. It depends how the user intends to reason about the class and how it is used.
No default choice
The other notable case is when instead of having multiple default states that could make sense, we have none. For example, suppose we have a class representing a manifold or surface.
What then is Manifold()
? It's an empty space, with nothing, no surface, no notion of distance or metric. But then it doesn't make sense to think of it as a manifold, but rather perhaps something more general like a topological space.
So, in this case, I would opt to delete the default constructor as well.