Why a try/catch in priority_queue::push/pop?!?

Paolo Carlini pcarlini@suse.de
Thu Aug 3 19:56:00 GMT 2006

Hi Howard,

>> I think the try/catch is very old, coming from the HP/SGI STL,  maybe 
>> I missing historical facts which I'd like to know... Anyone  helping?
> <shakes head> Can't blame this one on HP/SGI, just checked, no-try/ 
> catch there. :-)

I see... But I can find the strange beast already in libstdc++-v2, in 
gcc2.95.3, a *lot* of time! (admittedly I never played myself with the 
original HP/SGI STL, as distributed from the SGI web site, for example, 
only some friends of mine did...)

> I agree with your analysis of the code and the standard.  I think the  
> user could reasonably expect priority_queue<int>::push to have the  
> strong exception guarantee, though I note that the standard doesn't  
> quite say that (that I can find).

Ok, thanks a lot for your reply. Then, for the time being, I think I 
will simply remove the try/catch, then we'll see...


More information about the Libstdc++ mailing list