Boost logo

Boost :

From: Jaap Suter (J.Suter_at_[hidden])
Date: 2003-03-10 23:41:26


> Anyway, as Terje says, if the compile-time cost of the static
> assertion is mainly in the evaluation of the condition then the
> 'release mode' definition could simply be
>
> #define BOOST_STATIC_ASSERT(c) \
> typedef char boost_static_assert_typedef
>
> When using several asserts in the same context some compilers could
> complain about the duplicate typedef; if so pasting the expansion of
> __LINE__ shouldn't be that expensive either.

That seems indeed the best solution to me (with the __LINE__ included) as
most of the time is spend in calculations for the actual expression.

> But all this conjectures
> should be backed up by some measurement. Jaap?

Agreed. I will do some measurements this week and report back in a few days.

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