In order to conform to the rule regarding ownership of multiple objects we’ll delegate the responsibility of resource ownership to a couple of helper classes.
[I’m using the std::auto_ptr<> template here because it is standard, not because it is the ideal choice.]