120. Copy Semantics-II

Question.6

A developer defines only a destructor:

class Handler {
   int* buf;
public:
   Handler(int n) : buf(new int[n]) {}
   ~Handler() { delete[] buf; }
   // No copy constructor or operator= defined
};

Handler h1(10);
Handler h2 = h1;

Does the compiler still generate a copy constructor?

Need Help? Refer to the Quick Guide below

Select Answer