Imaginary losses
Posted Mar 27, 2008 20:56 UTC (Thu) by
pphaneuf (guest, #23480)
In reply to:
Imaginary losses by wahern
Parent article:
Striking gold in binutils
From my experience, the more common thing is not really try/catch, but letting the exception bubble up. Basically, you just want to clean up and tell your caller something went wrong.
We'll agree that if there is a clean up to do, it's probably equally there in C and in C++, right? The "big saving" in C++ is in the case where you just clean up and bubble up the exception. If a function doesn't have cleaning up to do, it doesn't even go in that function at all!
As they say, the fastest way to do something is to not do it.
(
Log in to post comments)