
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of kdsfinger@gmail.com Sent: Monday, March 20, 2006 9:59 AM To: Boost-users@lists.boost.org Subject: [Boost-users] how to use shared_ptr to wrap std::vector and returnfrom function?
hi, Boost users
Suppose I created a large data in a function and want to return it back to where the function was called. I want to return the pointer so that the deep copy of the large data is not needed and memory leak is nicely handled. Can someone let me know how to do it?
This is what auto_ptr is for, shared_ptr is overkill as far as I can
tell:
#include <iostream>
#include <memory>
#include <vector>
typedef std::auto_ptr