|
Boost : |
From: Beman Dawes (beman_at_[hidden])
Date: 2000-07-26 16:00:45
John Maddock wrote:
>... once I had figured out that
>"sizeof(incomplete_type)" gave useful error messages, I had to find a way
>to wrap this up, originally I just assigned this to an enum, but Steve
>wasn't so happy with this and prefered a typedef, so we added the
>ct_assert_test just as a way of converting an
integral-constant-expression
>to a type.
Ah! Well, it really does need documenting, the rationale for the code
choice isn't at all obvious (at least to me)>
I tend to like the enum idea. Whether a typedef is fully evaluated is a
bit tricky; when I was testing last fall I kept hitting cases where at
least some compilers didn't evaluate an unreferenced typedef. Of course
now I can't find the particular wording in the standard.
>BTW there is some difference of opinion on names here: I tend to prefer
>something with "assert" in the title, Steve (and others I think) have
gone
>for "postulate", any preferences?
"postulate" sounds a bit pompous. How about "require"?
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk