|
Boost : |
From: Jaap Suter (J.Suter_at_[hidden])
Date: 2003-03-09 20:37:18
> Then how about simply:
>
> #ifndef STATIC_NDEBUG
> # define BOOST_STATIC_ASSERT2(e) BOOST_STATIC_ASSERT(e)
> #else
> # define BOOST_STATIC_ASSERT2(e)
> #endif
I guess that ';' would work in most cases. I can't think of a case where it
wouldn't, although it can give warnings on some compilers (try closing a
namespace with curly-brace-semi-colon on some compilers).
Alternatively, we could use::
> #ifndef STATIC_NDEBUG
> # define BOOST_STATIC_ASSERT2(e) BOOST_STATIC_ASSERT(e)
> #else
> # define BOOST_STATIC_ASSERT2(e) BOOST_STATIC_ASSERT(true)
> #endif
I'm wondering why we want to make this a 2nd static_assert at all. It seems
to me that once we acknowledge that a compile-time program 'runs' at compile
time, we have a compile time 'debug' and 'release' mode with the
accompanying debug and release versions of the compile time assert. I would
like to see the primary STATIC_ASSERT defined this way, but that's just me
of course :).
Regards,
Jaap Suter
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk