Now with C++11
, should we prefer vector<unique_ptr<>>
or boost::ptr_vector
to store pointer's to objects if we want managed memory?
Asked
Active
Viewed 1,041 times
3

Cookie
- 12,004
- 13
- 54
- 83
-
I'd suggest ptr_vector because it's a bit simpler conceptually and probably slightly more efficient. Then again, it all depends on use cases – sehe May 26 '14 at 14:24
-
3This [question](http://stackoverflow.com/q/9469968/1053968) covers some of the differences between the two options. – Tanner Sansbury May 26 '14 at 14:29
1 Answers
2
I would suggest vector<unique_ptr<>>
as it is supported by compiler. no extra effect. otherwise, boost
need your import into your project.

Jerry YY Rain
- 4,134
- 7
- 35
- 52