From -3650999904244509869
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,e445fe05b100a0aa
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-08-23 03:30:02 PST
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Delivered-To: std-c++@ncar.ucar.edu
From: "Ken Hagan" <K.Hagan@thermoteknix.co.uk>
Newsgroups: comp.std.c++
Subject: Re: C++ exception handling
Message-ID: <1030093822.25233.0.nnrp-10.3e31ffea@news.demon.co.uk>
References: <20020802141846.59203.qmail@web9902.mail.yahoo.com> <_2S29.267$a01.33863850@newssvr13.news.prodigy.com> <1028797052.3258.0.nnrp-13.3e31ffea@news.demon.co.uk> <3D54EE8E.DCE1A08D@iobox.com> <1029750082.26799.0.nnrp-10.3e31ffea@news.demon.co.uk> <3D628B51.35E8C851@iobox.com>
X-NNTP-Posting-Host: mailgate.thermoteknix.com:62.49.255.234
X-Trace: news.demon.co.uk 1030093822 nnrp-10:25233 NO-IDENT mailgate.thermoteknix.com:62.49.255.234
X-Complaints-To: abuse@demon.net
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Date: Fri, 23 Aug 2002 05:25:42 CST
Lines: 53
Xref: archiver1.google.com comp.std.c++:13356

"Sergey P. Derevyago" <non-existent@iobox.com> wrote...
> Yes. It seems like we have different goals:
> 1. I want to write exception safe code, so (statically checked) nothrow is
the
> solution, IMHO.
> 2. While you want to futher extend those bra^H^H^H dead-born exception
> specifications :)

Actually my interest also lies with 1 rather than 2. It's just that I can't
see
how to achieve one without the other. I'm not prepared to declare all my
template functions as throw(...), throw(), throw(std::exception) of anything
else, because any particular ES will stop me using the template with certain
types, at least usefully. Let me break down my chain of thought here.

 1 I'm only interested in checking "nothrow" at a few places in my code.
 2 The appropriate ES of other functions is just "whatever they can throw".
 3 That depends on what they call.
 4 For non-templates, "what they call" was fixed at compile-time, so the
    original ES proposal was workable.
 5 For template functions it isn't fixed until instantiations are made; To
check
   at compile-time, the ES would need to be a formula for "how to compute
   the actual ES for given template parameters".

That's why I gave the impression of wanting to extend ES. In fact, I don't.
I'd
much prefer either of the following.

 [A] Force whatever tool does template instantiation, to generate an "actual
ES"
        independently of what's in the source code. That can then be checked
by
        for the entire program in one go.
 [B] Decide that the above is too much of a requirement for compiler
vendors,
       but suitable for external tools like lint.

In either case, the programmer would only need to write an ES where they
wanted an actual check, and check failures would not prevent the build from
being successful.

With this kind of checking available, I can't see any need for the current
run-time
semantics, so I'd be inclined to ban^H^H^H deprecate them.


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



