// This code illustrates why we sometimes need the “explicit” // declaration on a constructor, to avoid undesirable behavior. class CheapVec { public: CheapVec() : data(nullptr), count(0) { } /* explicit */ CheapVec(int n) : data(new int[n]), count(n) { } ~CheapVec() { delete[] data; } private: int *data; int count; }; int main() { CheapVec a; // An empty vector CheapVec b(3); // A vector of three items a = 3; // This compiles!? }