Topic: C++0x proposal: Extended Exception Specifications


Author: Davide Bolcioni <6805b3x001@sneakemail.com>
Date: Fri, 23 Aug 2002 22:28:24 GMT
Raw View
Greetings,
my proposal is to extend exception specifications to allow a syntax like:

   void f() throw (<thrown-stuff>) catch (<caught-stuff>)
   {
     ...
   }

You can find a first draft of the proposal here:

http://members.xoom.virgilio.it/dbolcioni/exception-specifications-1.html

Highlights:
- side-steps any attempt at "throw (auto)", e.g. having the programmer
   write full exception specifications for all functions with the
   attendant ripple effect known to Java programmers;
- compatible with existing syntax;
- pass-through functions need little care, only functions actually
   throwing or catching exceptions would have specifications;
- the "catch" clause lets the programmer say "at this point, I think I
   have handled these";
- the machinery lets one handle "this function can be invoked in signal
   handlers but this other cannot" using exception specifications.

I am going to refine the proposal in the near future: feel free to bring
it down in flames. Any comment is welcome, including about grammar (not
a native speaker).

Davide Bolcioni
--
Linux - the choice of a GNU generation.

---
[ 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                       ]