If you didn't want to have your own pointer wrapper template you could use auto_ptr here instead