
On Tue, Sep 16, 2008 at 3:25 PM, Peter Barker
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 _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Ah I see,.... so the code for ptr_map is intended to be as much like the code for std::map as possible! Got it now, thanks. - Rob. -- ACCU - Professionalism in programming - http://www.accu.org