Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-07-31 09:50:07


----- Original Message -----
From: "William Kempf" <sirwillard_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Monday, July 31, 2000 10:08 AM
Subject: [boost] Re: compile time asserts [preconditions]

> I strongly suggest you pick a different name. Preconditions already
> have a very well known meaning, for which a compile time assert does
> not work. Specifically, a precondition is one of the three
> components that build up the foundation of DBC (design by contract):
> precondition, postcondition and invariant. All of these are runtime
> assertions. A precondition is that that must be upheld before a
> function can be called (aka it's what you must insure when you call a
> function).

They're not completely unrelated: the compile-time assert is a very special
case of precondition, where the precondition can be checked by the compiler.
That said, I think the name "precondition" suffers the same problem as many
of the other names that we've seen: namely, that it looks like just another
way to write "assert". I am getting tired of listening to myself nag y'all
about this, but I insist that the name needs to contain some indication that
there is static checking going on:

BOOST_COMPILER_ASSERT
BOOST_STATIC_PRECONDITION
BOOST_STATIC_ASSERT
BOOST_STATIC_CHECK

all work, with BOOST_STATIC_ASSERT being my favorite so far.


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