Boost logo

Boost :

From: John Maddock (John_Maddock_at_[hidden])
Date: 2000-11-09 08:02:42


Beman,

>Perhaps I should just work on a core proposal for a new language
>feature. All of the macro uses we are talking about are needed to get
>__FILE__ and __LINE__. How about two new special symbols:
>
>namespace boost {
> static_assert( bool exp, const char * file=__FILE_AT_USE,
> int line=__LINE_AT_USE );
>}
>
>The compiler is required to replace these with the appropriate value at
the
>point of a call to static_assert(), rather than at point of declaration.

If this were going forward as part of the standard I would say yes call in
"static_assert" and place it <cassert>, either as a regular macro, or as a
core language extention (depending how the vendor sees it).

However, there is a problem with your approach wrt boost: how does the
static_assert function you've defined above, convert the bool parameter to
a static assertion (as an integral constant expression)?

- John.


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