Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC++rule of 5 and rule of 0Single-choice MCQ

What is the consequence of declaring a user-provided destructor in this class?

struct Buffer { int* data; Buffer(int n) : data(new int[n]) {} ~Buffer() { delete[] data; } // no other special members declared }; Buffer make() { Buffer b(10); return b; }