What is Auto_ptr? Is it better than normal pointer assignment? If so, I would use this forever.
---------------------------------------------------------------------Code:void processAdoptions(istream& dataSource) { while (dataSource) { auto_ptr<ALA> pa(readALA(dataSource)); pa->processAdoption(); } } ---------------------------------------------------------------------- void processAdoptions(istream& dataSource) { while (dataSource) { ALA *pa = readALA(dataSource); try { pa->processAdoption(); } catch (...) { // catch all exceptions delete pa; // avoid resource leak when an // exception is thrown throw; // propagate exception to caller } delete pa; // avoid resource leak when no } // exception is thrown }