Boost logo

Boost Users :

From: Thomas Matelich (matelich_at_[hidden])
Date: 2006-03-20 13:02:30


On 3/20/06, kdsfinger_at_[hidden] <kdsfinger_at_[hidden]> wrote:
> boost::shared_ptr< std::vector<int> > getV(){
> boost::shared_ptr< std::vector<int> > v;
> v->push_back(1);
> v->push_back(2);
> // bla bla bla
> return v;
> }

you forgot to create a vector for v.

either:
boost::shared_ptr<std::vector<int> > v(new std::vector<int>);
or:
v.reset(new std::vector<int>);

oughtta do it.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net