Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-08-23 09:14:40


From: "Scott McCaskill" <scott_at_[hidden]>
> > Opinions? This behavior (with one minor exception) is implementable now,
> at
> > least on paper.
> >
>
> I think this would be a great solution _if_ you could guarantee that it
> could not be circumvented (i.e. by catch(...)). Unfortunately, you can't
> (today), so it's a fairly fragile solution and therefore of dubious value.

What do you mean by 'circumvented by catch(...)'? catch(...) should catch
the exception - that's a feature:

void f(mutex & m)
{
    m.lock();

    try
    {
        g();
    }
    catch(...)
    {
        m.unlock();
        throw;
    }

    m.unlock();
}

--
Peter Dimov
Multi Media Ltd.

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