From: Hillel Y. Sims (hsims_at_[hidden])
Date: 2002-09-30 11:10:25
"Peter Dimov" <pdimov_at_[hidden]> wrote in message
> transaction t1 = do_push_back(vector1, e1);
> transaction t2 = do_push_back(vector2, e2);
> transaction t3 = do_push_back(vector3, e3);
> // ...
> // ...
> ... but at some point the overhead of writing do_push_back is amortized
> do_push_back wins against "raw" ScopeGuard.
Agreed, but when comparing between "once-off" try/catch/re-throw blocks vs.
ScopeGuard, I will personally attempt/recommend to use ScopeGuard first and
only fall-back to try/catch/re-throw if that absolutely fails (which is
really not very often). Pure RAII is "best", but typically requires a
slightly higher initial investment.
-- Hillel Y. Sims FactSet Research Systems hsims AT factset.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk