Boost logo

Boost :

From: Ed Brey (brey_at_[hidden])
Date: 2000-10-30 09:05:03


From: "John Maddock" <John_Maddock_at_[hidden]>
> The static assertions code is now ready for review:

I realize the review hasn't been scheduled yet, but comments before the
official review period are OK too, right?

Documentation:

1. It should be made clear that static assert is not allowed at global
namespace scope. (Actually, even better would be to modify the code so that
static assertions worked at global namespace scope, given the existing
caveat about being used in include files when the compiler has a problem
with identical typdefs. AFAICT, all that would be needed is to remove the
leading underscore from _boost_static_assert_typedef_.)

2. Two different terms, "static assert" and "compile time assert", are used.
They appear to be synonymous; however, no explanation is given describing
the circumstances that cause one or another to be preferred. It may be
simpler to settle on a single term. (This applies to the implementation
code, too.)

3. Example 2's static assert has a superfluous pair of parentheses. Example
3's second static assert has a superfluous pair of parentheses around
UnsignedInt. In both cases, the reader is left to wonder whether there is
some bizarre reason that is a parentheses are needed that he just can't
think of.

4. There are mysterious non-breaking spaces and a period at the end of the
HTML file.

Implementation:

1. A nit concerning, #ifdef BOOST_USE_ENUM_STATIC_ASSERT and #ifdef
BOOST_MSVC: Generally in boost, ifndef is used, so that the primary
implementation is given first, with alternatives for special situations
following.

2. Without looking through the mailing archives (assuming the answer is
there), I have no clue why the chained BOOST_DO_JOIN to BOOST_DO_JOIN2
construct is used. A comment there would be very nice.

3. BOOST_USE_ENUM_PRECONDITION referred to in the comments should be
BOOST_USE_ENUM_STATIC_ASSERT.

4. The comment fragment "// It's is not particularly" has two verbs.

Overall, I'm very pleased with how well the static assert solution works.
For me, it will make relying on the compiler/platform specifics necessary to
deal with COM much more comforting. :-)


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