Boost logo

Boost :

From: Daniel Wallin (dalwan01_at_[hidden])
Date: 2003-09-24 16:13:43


At 22:46 2003-09-24, Peter Dimov wrote:
>Daniel Wallin wrote:
> >
> > FWIW, here's the scopeguard implementation that I use:
> >
> > <snip>
> >
> > typedef const detail::guard_base& scope_guard;
>
>You are assuming that
>
> scope_guard g = make_guard(f);
>
>will only create a single instance of guard_impl<F> (no copies), but this is
>not guaranteed.

Right, my mistake.

    guard_base(const guard_base& rhs)
       : m_dismissed(rhs.m_dismissed)
    { rhs.dismiss(); }

When I said "that I use" I actually meant "that I once wrote with the intent
to use, but has never actually used". ;)

---
Daniel Wallin

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk