From -5207302605896234575 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,972722ed514d508a X-Google-Attributes: gidf78e5,public X-Google-ArrivalTime: 2001-07-31 10:06:02 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!skynet.be!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail From: "Andy Salnikov" Newsgroups: comp.std.c++ Subject: Re: try block as main block of a function Date: Tue, 31 Jul 2001 17:05:44 GMT Organization: BINP, Novosibirsk, Russia Approved: Fergus Henderson , moderator of comp.std.c++ Message-ID: <9k5f5h$16cuv$1@sky.inp.nsk.su> References: <3b6061b5.1188820@news.terra.es> <9jr8bd$19vqd$1@ID-49767.news.dfncis.de> <9jtbcc$104r4$1@sky.inp.nsk.su> X-Trace: mail2news.demon.co.uk 996599151 mail2news:19027 mail2news mail2news.demon.co.uk X-Complaints-To: abuse@demon.net X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) Mime-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit NNTP-Posting-Date: 31 Jul 2001 05:19:45 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Lines: 39 Xref: archiver1.google.com comp.std.c++:6836 "Francis Glassborow" wrote in message news:hSy9obBruRZ7EwIG@ntlworld.com... > That is my point, they do not. If you wrap a function in a try block and > an exception is thrown the function does not return after processing an > exception but rethrows. > This sounds strange and almost unreasonable. Where is the place in standard which says so? The following simple program does what I would expect, i.e. prints both lines to cout: #include #include void f() try { throw std::logic_error("no logic here") ; } catch ( const std::exception& e ) { std::cout << "exception caught: " << e.what() << std::endl ; } int main(int,char**) { f() ; std::cout << "returned from f()" << std::endl ; } Cheers, Andy. --- [ 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.research.att.com/~austern/csc/faq.html ]