delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/04/09/06:28:44

Date: Sat, 9 Apr 94 19:02:28 JST
From: Stephen Turnbull <turnbull AT shako DOT sk DOT tsukuba DOT ac DOT jp>
To: h_ellenberger AT p14 DOT lemas DOT chg DOT imp DOT com
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: C++ exception handling

I don't have Stroustrup and Ellis at hand, and am not sure that GNU
C++ exception handling is identical.  But I think you need to specify
which errors you're going to try to catch in the try block:

try (error1, error2) { throw(error1(initializer)); func(); };
catch (error1) { /* handle type 1 errors */ };
catch (error2) { /* handle type 2 errors, presumably thrown by func() */ };

I probably have the parenthesization wrong in the try and catch
blocks.
    I also believe the throw(error) in the definition of xdiv() is
redundant, but I'm not sure.
    If I have time, I check the book later.
    --Steve

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019