
16 Sep
2008
16 Sep
'08
2:25 p.m.
At risk of sounding a complete wally, I have completely failed to understand why the second version is any way preferrable to the first.
Why would you want to do this?
- Rob.
Are you asking why you would you use a boost::ptr_map over a std::map? I believe it's so the container takes ownership of the pointed to objects. http://www.boost.org/doc/libs/1_35_0/libs/ptr_container/doc/ptr_container.ht... contains this line: "For each of the standard containers there is a pointer container equivalent that takes ownership of the objects in an exception safe manner. In this respect the library is intended to solve the so-called polymorphic class problem." Regards, Pete