#include#include "QueryResult.h" int main() { std::auto_ptr qr(new QueryResult()); qr->execute(); return 0; }
#includeIn this example, we use the scoped_ptr class from the Boost C++ library instead of the auto_ptr. The scoped_ptr behaves similarly to auto_ptr, but with some differences in the way it manages memory. Package library: The Boost C++ library.#include "QueryResult.h" int main() { boost::scoped_ptr qr(new QueryResult()); qr->execute(); return 0; }