← Destructors & Object Lifetime

Add a Destructor

easy

Add a destructor to Resource that prints Destroyed: <name>. The expected output pins down exactly when it should fire: right as the inner { } block ends, after "using widget" but before "after" – not at the end of main, and not anywhere you’d need to call it explicitly.

Your solution

"Run" uses the sample stdin (none). "Submit" checks your code against all 1 test case.

Test results

Submit your solution to run it against all test cases.

Hints

    Reference solution