Boost logo

Boost :

From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2004-02-29 12:07:39


"John Maddock" <john_at_[hidden]> wrote

[BOOST_TRY like macros]

> > BCB gives unreachable
> > code warning (but I'll try to find workaround).
>
> I doubt you'll find a satisfactory one, there are pragmas that can disable
> those warnings, but that introduces even more code than the traditional:
>
For BCB this works without warning:
   if (!"") { ... }

> I suggest we review these when the first of these lib's comes up for
review,
> anyone else want to comment?
>
First library to review is circular_buffer and this one uses less
generic macros:

#if !defined(BOOST_NO_EXCEPTIONS)
    #define BOOST_CB_TRY try {
    #define BOOST_CB_UNWIND(action) } catch(...) { action; throw; }
#else
    #define BOOST_CB_TRY
    #define BOOST_CB_UNWIND(action)
#endif
-------------------------------

I would suggest to add:

#if !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_TRY try
# define BOOST_CATCH(x) catch(x)
# define BOOST_RETHROW throw
#else
# define BOOST_TRY#
# define BOOST_CATCH(x) if(0)
# define BOOST_RETHROW
#endif

/Pavel


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