Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2002-11-16 13:57:43


On Sat, 16 Nov 2002 00:07:11 +0100, "Terje Slettebø"
<tslettebo_at_[hidden]> wrote:

>>From: "Gennaro Prota" <gennaro_prota_at_[hidden]>
>> Who knows? When I encounter these sorts of situations I dream a
>> standard where propositions can be demonstrated like in mathematics or
>> counter-examples provided. Don't you?
>
>You're not the only one. Bjarne Stroustrup says the same in "The Design and
>Evolution of C++" (p. 103):

Ouch, it's too much time that my bookshelf claims that book.

>Much
>later, the ANSI/ISO C++ committee had a stream of formal definition experts
>explain their techniques and tools and give their opinions of the extent to
>which a genuine formal approach to the definition of C++ would help us in
>the standards effort.

Thank you very much for typing all that stuff! In fact, I'm quite
curious about those opinions.

I really miss formality in the standard. Even answering a simple
question like: "is static_cast<unsigned int>(-1) guaranteed to give
UINT_MAX on all conforming implementations?" is quite a project. If
you think to the mathematical analogy those issues should be the kind
of elementary propositions that you find just after a definition
(uniqueness of inverse, and the like).

Just imagine what it can be demonstrating anything which deals with
that mystery of the logic that are references (they are not objects,
but are not expressions either 'cause they are something whose
"existence" must be considered in run-time, they are not... what they
are???)

To complicate things even further, there's the bad habit that
"general" incorrect assertions are made though the standard, except
that they are corrected for the "special cases" elsewhere. So that you
can never know if a given paragraph contains everything you need to
know. For instance, 6.6.3/2 says that

    int main() {}

invokes undefined behavior. The assertion is "corrected" in 3.6.1 but
you see that this policy is quite dangerous when you have a doubt and
you are looking for a quote. A similar situation concerns pure virtual
destructors: 10.4/2 says it need be defined only if explicitly called
with the qualified-id syntax (5.1); of course that's manifestly wrong.
The "correction" is in 12.4/7 and 12.4/6.

Now I think you begin to see why I'm so suspicious when
"demonstrating" on the basis of what the standard says.

Genny.


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