|
Boost : |
From: Maxim Egorushkin (e-maxim_at_[hidden])
Date: 2003-09-28 08:36:31
"John Sheehan" <dumbnose_at_[hidden]> wrote in message news:Law10-OE48rV4ZneAzd00000d1d_at_hotmail.com...
> I have posted the updated version to:
>
> http://www.dumbnose.com/src/scope_guard.h
>
Have you test it?
template<typename Fun>
scope_guard_base
make_scope_guard_impl(const Fun& fun){
return scope_guard_impl<Fun>(fun);
}
There is slicing. That means your scope_guard_impl<> destructor is called while leaving the make_scope_guard_impl function and you get a useless copy of the scope_guard_base subobject.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk