Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > are the boost ptr containers exception safe?

Reply
Thread Tools

are the boost ptr containers exception safe?

 
 
Peter
Guest
Posts: n/a
 
      12-08-2006
boost:tr_vector<animal> vec;
vec.push_back( new animal );

What does happen if push_back() fails -- do I have a leak?

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      12-08-2006
Peter wrote:
> boost:tr_vector<animal> vec;
> vec.push_back( new animal );
>
> What does happen if push_back() fails -- do I have a leak?


Did you know that Boost has its own discussion forums?


 
Reply With Quote
 
 
 
 
Pavel Vozenilek
Guest
Posts: n/a
 
      12-12-2006

"Peter" wrote:

> boost:tr_vector<animal> vec;
> vec.push_back( new animal );
>
> What does happen if push_back() fails -- do I have a leak?
>


No leak.

All Boost libraries are designed exception safe (modulo bugs).
/Pavel


 
Reply With Quote
 
Roland Pibinger
Guest
Posts: n/a
 
      12-12-2006
On Tue, 12 Dec 2006 19:19:48 +0100, "Pavel Vozenilek" wrote:
>"Peter" wrote:
>
>> boost:tr_vector<animal> vec;
>> vec.push_back( new animal );
>>
>> What does happen if push_back() fails -- do I have a leak?

>
>No leak.
>
>All Boost libraries are designed exception safe (modulo bugs).


To be more precise, wrt to exception-safety (as defined in
http://www.boost.org/more/generic_exception_safety.html) the function
provides the basic guarantee but not the strong guarantee.

Best regards,
Roland Pibinger
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
difference between *ptr++ and ++*ptr ? Jason C Programming 19 05-19-2005 04:50 PM
is (!ptr) or (ptr) valid way to check for NULL or NOT NULL? G Fernandes C Programming 9 02-27-2005 03:07 AM
const ptr to const ptr ? franco ziade C Programming 3 02-17-2005 04:30 AM
How to convert a double **ptr in a double const ** const ptr? Heiko Vogel C Programming 3 09-14-2004 10:23 AM
what's the difference between delete ptr and ptr=0 -dont they accomplish the same Sid C++ 5 07-29-2004 03:42 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57