|
Boost : |
From: Nathan Myers (ncm_at_[hidden])
Date: 2000-07-31 16:44:56
William Kempf wrote:
> 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).
It's not just a matter of choosing a word already in use. To call
it BOOST_PRECONDITION would be to mix levels: assertions are used to
enforce preconditions, among other things. It would be like calling
a disk block a file. Yes, sometimes a file lives in a disk block, but
a file also has a directory entry and/or an inode, and a file often
spans disk blocks, and some things stored in blocks aren't files.
This construct does not itself constitute a precondition, it's just
(maybe) enforcing one.
Nathan Myers
ncm at cantrip dot org
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk