Re: The D Programming Language
Gerhard Menzl <clcppm-poster@this.is.invalid> writes:
David Abrahams wrote:
Gerhard Menzl <clcppm-poster@this.is.invalid> writes:
Your choice of terms was at least
misleading: someone unfamiliar with the C++ exception mechanism could
easily interpret it as describing a compile-time check, which is
precisely what C++ does not offer. To avoid this confusion,
especially when comparing C++ with Java, which does have static
checks, I think it is important to distinguish between "cannot throw"
and "will abort if it throws".
What's the difference between a function that "will abort if it
throws" and one that "might abort (for whatever reason)?"
There is a difference between a compile-time guarantee and an abort at
runtime. That C++ does not offer the former may be obvious to you, which
is probably why you didn't find the statement misleading, but it could
easily lead less experienced readers of this group to believe there is
such a thing as compile-time exception specification checking. I don't
quite understand why you are so opposed to my attempt of clarification.
I wouldn't say you attempted to clarify anything, and if you had put
it as a clarification I probably wouldn't have objected. I was opposed
to what seemed to be a flurry of attacks on Peter's original
statement, which, taken in its context, was IMO understandable,
correct, and insightful:
[someone else]
> Look instead at C++'s throw(). Seems completely bogus to me. Why?
> Because in truth, it guarantees absolutely nothing, unlike Java.
[Peter]
Wrong again. C++ throw() guarantees that the function will not throw
anything
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]