From 5698178297101527216
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f78e5,972722ed514d508a
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-08-06 12:53:01 PST
Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!212.74.64.35!colt.net!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: Mike Schilling <mike.schilling@ebay.sun.com>
Newsgroups: comp.std.c++
Subject: Re: try block as main block of a function
Date: Mon,  6 Aug 2001 19:52:51 GMT
Organization: Sun Microsystems
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <3B6ECE3D.9FBA1D55@ebay.sun.com>
References: <3b6061b5.1188820@news.terra.es> <cKmyuWA$AJY7EwG1@ntlworld.com> <9jr8bd$19vqd$1@ID-49767.news.dfncis.de> <OOB2fjAifdY7Ewle@ntlworld.com> <9k34ms$2akk5$1@ID-49767.news.dfncis.de>
X-Trace: mail2news.demon.co.uk 997127576 mail2news:27553 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=iso-8859-1
X-Accept-Language: en
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mulga.cs.mu.OZ.AU id FAA03808
Lines: 18
Xref: archiver1.google.com comp.std.c++:6872

Anthony Williams wrote:
> For functions [a try-block as the body of a function]
> saves a level of indentation and a pair of braces, but
> otherwise is identical to a function body containing nothing but a try
> block. The only reason I can see for not recommending it is portability
> (e.g.Daniel Garc=EDa's original problem wrt MSVC).

It's also a rare construct, confusing to anyone who hasn't seen it
before, and will cause problems using editors which know that a function
begins with a brace in column 1, as well as other code analysis tools.=20
IMHO, all good reasons not to recommend it.

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



