Boost logo

Boost Users :

From: Meryl Silverburgh (silverburgh.meryl_at_[hidden])
Date: 2008-07-04 13:16:35


Hi,

I have a legacy application in C++, and I would like to switch it to
use boost smart pointers.
Can you please tell me what is the best approach for the switch?

This application uses stl vector as the class container,
vector<MyClass*>

function which takes in MyClass*
void f1(MyClass* aMyClass) { ...}

function which returns MyClass*
MyClass* f1() {

return new MyClass();
  }

I am thinking just global replace all MyClass* with MyClassPtr

And then put in a common .h file

typedef MyClassPtr shared_ptr<MyClass>

Will this approach work?

Thank you for any tips.


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