🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #3629

Exceptions: function-try-block

#3629
From: Don Organ
Date: Sat, 09 Mar 1996 04:39
54 lines
2349 bytes
In reading Chapter 15 - Exception handling in the April '95 Draft,
I saw something that looked new to me:

function-try-block:
	try ctor-initializer-opt function-body handler-seq

Where
	try is a literal,
	ctor-initializer (without the -opt) is defined in section
		12.6.2 "Initializing bases and members"
	function-body is defined in section 8.4 "Function Definitions"
	handler-seq is the series of catch statements.
function-try-block is referenced from section 8.4 as one of the 2 forms
of a function-definition.

They way I interpret all of this is that the following
should be legal:

class X {
public:
	X(int arg1=0);

	int member1;
	int member2;
};

X::X(int arg1) try : member1(0), member2(0)
{
}
catch (...) {};

I.e. the try keyword precedes both the colon and the member initializer
list and the catch keyword is not contained in a block.
The catch handler would be entered if any exceptions were thrown
either from the member initializers (not likely in this case since the
members are simple types) are the body of the constructor.

What is the correct interpretation?
Is there any published material regarding usage of this form?
Are there any compilers that support this form?


=======================================
Don Organ     dorgan@mtest.teradyne.com
Direct: 408-441-3123  FAX: 408-451-3201
The Megatest Division of Teradyne, Inc.
880 Fox Lane San Jose, CA    95131-1685
=======================================
---
[ 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         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
Technical Details
Message-ID: <9603081943.AA02705@dawn.mtest>
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back

Show Full Headers
Complete Article Headers
From: dorgan@mtest.teradyne.com (Don Organ)
Message-ID: <9603081943.AA02705@dawn.mtest>
X-Original-Date: Fri, 8 Mar 1996 11:43:19 -0800
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back
Date: 09 Mar 96 04:39:23 GMT
Approved: fjh@cs.mu.oz.au
Organization: -
Newsgroups: comp.std.c++
Subject: Exceptions: function-try-block
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBFAgUBMUELiOEDnX0m9pzZAQGJLQGAhptxcHAYzh4txSedelV+rZ0trfjlQe5u
 NpIsYp8zguN+3raY17G9ha3YowCTvVu9
 =1Vlu