|
Boost Users :
|
- Next message: Thorsten Ottosen: "Re: [Boost-users] [assign][ptr_container] Exception safety of ptr_list_of, ptr_push_back, ptr_map_insert, etc."
- Previous message: Hickman, Steve (AdvTech): "Re: [Boost-users] [multi state machine/ MSM] execute_queued_events"
- Next in thread: Thorsten Ottosen: "Re: [Boost-users] [assign][ptr_container] Exception safety of ptr_list_of, ptr_push_back, ptr_map_insert, etc."
- Reply: Thorsten Ottosen: "Re: [Boost-users] [assign][ptr_container] Exception safety of ptr_list_of, ptr_push_back, ptr_map_insert, etc."
I am trying to understand how ptr_list_of or ptr_push_back provide more exception safety.
I can write something like:
boost::ptr_vector<Foo> vec;
push_back(vec)(new Foo)(new Foo);
Is the order of evaluation of the two "new Foo" expressions indeterminate here? If not, then if the second new throws, the destructor of vec should be invoked. The Foo object allocated by the first new and now part of vec should also get released as part of that.
--
Aaron Levy
aaron.levy_at_[hidden]
- Next message: Thorsten Ottosen: "Re: [Boost-users] [assign][ptr_container] Exception safety of ptr_list_of, ptr_push_back, ptr_map_insert, etc."
- Previous message: Hickman, Steve (AdvTech): "Re: [Boost-users] [multi state machine/ MSM] execute_queued_events"
- Next in thread: Thorsten Ottosen: "Re: [Boost-users] [assign][ptr_container] Exception safety of ptr_list_of, ptr_push_back, ptr_map_insert, etc."
- Reply: Thorsten Ottosen: "Re: [Boost-users] [assign][ptr_container] Exception safety of ptr_list_of, ptr_push_back, ptr_map_insert, etc."
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