Quote:Original post by DieterVW
Anthes' design is fine too, though the example forgets to release() the auto_ptr's hold on the variables before the constructor ends - there by freeing the memory too soon. But that is easily remedied.
My bad, should be release(), not just plain assignment.
heapObj = a.release(); safeObj = b.release();