From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13827 invoked by alias); 17 Jan 2003 07:15:29 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 13806 invoked from network); 17 Jan 2003 07:15:23 -0000 Received: from unknown (HELO ns.isdd.sk) (213.151.209.11) by sources.redhat.com with SMTP; 17 Jan 2003 07:15:23 -0000 Received: (qmail-ldap/ctrl 27804 invoked from network); 17 Jan 2003 07:15:23 -0000 Received: from liptak.isdd.sk (HELO liptak) ([10.10.1.164]) (envelope-sender ) by 0 (qmail-ldap-1.03) with SMTP for ; 17 Jan 2003 07:15:23 -0000 From: =?iso-8859-2?Q?Michal_Lipt=E1k?= To: Subject: RE: Exception Handling Date: Fri, 17 Jan 2003 07:15:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Importance: Normal In-Reply-To: X-SW-Source: 2003-01/txt/msg00143.txt.bz2 I think it should be done like this: throw MyException("method","class","message"); and then catch it: try { } catch(MyException& e) { } because the new operator can throw as well.. can't it? m. > -----Original Message----- > From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org]On > Behalf Of Ryan Cuprak > Sent: Thursday, January 16, 2003 6:15 PM > To: gcc-help@gcc.gnu.org > Subject: Exception Handling >=20 >=20 >=20 > Hello, > Is it safe to throw an exception as such: > throw new MyException ( "method","class","message); >=20 > and then catch it as: > try { > } > catch ( MyException *e ) { > //-- do something > delete e; > } > I am just looking for some guidelines on exceptions. In doing=20 > google searches > for info, I came across an email stating that the implementation=20 > of exceptions > varies by compiler in that some runtime systems do a binary copy of the > exception and then pass it to the catch etc. >=20=20 > Thanks, > Ryan >=20