If you write as below:
class Empty{};
it's essentially the same as if you'd written this:
class Empty {
public:
Empty() { ... } // default constructor
Empty(const Empty& rhs) { ... } // copy constructor
~Empty() { ... } // destructor — see below
// for whether it's virtual
Empty& operator=(const Empty& rhs) { ... } // copy assignment operator
};
Things to Remember
-
Compilers may implicitly generate a class's default constructor, copy constructor, copy assignment operator, and destructor.