Boost logo

Boost :

Subject: Re: [boost] [inspect] exceptions (FW: [Boost-users] no exceptions)
From: Robert Kawulak (robert.kawulak_at_[hidden])
Date: 2011-03-24 19:58:18


> From: Brian Wood
> In the last 2
> or 3 months I added a try/catch and throw without arguments to
> a file in my library --
> http://webEbenezer.net/misc/ReceiveCompressedBuffer.hh .

You can eliminate the try/catch from the code. For example, instead of:

        try {
          // do sth dangerous using cmpRead
        } catch(...) {
          cmpRead = 0;
          throw;
        }

write:

        auto tmp = cmpRead;
        cmpRead = 0;
        // do sth dangerous using tmp
        cmpRead = tmp;

Best regards,
Robert


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