you can as well use the smart pointers in std::tr1, if your compiler is up-to-date.