|
Boost : |
From: Reid Sweatman (borderland_at_[hidden])
Date: 2000-07-31 10:23:28
Why not just provide both usages by defining one as the other? Then you can
make the intended semantics clear without changing the behavior of the code.
Reid Sweatman
> -----Original Message-----
> From: tholenst_at_[hidden] [mailto:tholenst_at_[hidden]]
> Sent: Sunday, July 30, 2000 5:30 AM
> To: boost_at_[hidden]
> Subject: [boost] compile time asserts [preconditions]
>
>
> John Maddock writes:
> > With regard to naming, I chose BOOST_PRECONDITION(x) - the
> intent is to say
> > "look guys if this isn't true then don't even bother compiling this
> > code",
> The problem is this that sometimes my preconditions are rather
> asserts:
>
> double sqrt(double x)
> {
> PRECONDITION(x >= 0);
>
> // usage of newton to find square root cut out.
> }
>
> So this would rather be an assert. Thats why I like
> BOOST_COMPILETIME_ASSERT better.
>
> Thomas
>
>
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk