Article View: comp.std.c++
Article #3940Re: Must exception classes have copy constructors?
From: David Byrden
Date: Sat, 06 Apr 1996 19:33
Date: Sat, 06 Apr 1996 19:33
25 lines
1786 bytes
1786 bytes
Alan Griffiths <aGriffiths@ma.ccngroup.com> wrote:
>I've just tried porting some code to MSVC4 (it compiles and works with
>SC7.1 and BC4.5).
>
>In effect it appears that the Microsoft compiler _requires_ anything
>thrown as an exception to have an accessible copy constructor. (I've
>tended to make copy constructors private to ensure catch-by-reference
>and aviod slicing bugs.)
>
>Looking through the DWP I can't see any reason to require a copy
>constructor, but there are references to copying temporaries.
What DWP did you read? The January 96 version requires that the
"throw" statement have access to the copy constructor and destructor of a
thrown object.
David
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Technical Details
Message-ID:
<4k36ab$n6s@nuacht.iol.ie>Path:
arc1-ca.pugleaf.net!fido.asd.sgi.com!austernReferences:
<606373375wnr@ma.ccngroup.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!fido.asd.sgi.com!austern From: David Byrden <Goyra@iol.ie> Newsgroups: comp.std.c++ Subject: Re: Must exception classes have copy constructors? Date: 06 Apr 1996 11:33:33 PST Organization: Ireland On-Line Approved: austern@isolde.mti.sgi.com Message-ID: <4k36ab$n6s@nuacht.iol.ie> References: <606373375wnr@ma.ccngroup.com> NNTP-Posting-Host: isolde.mti.sgi.com X-Original-Date: 5 Apr 1996 13:13:47 GMT X-Mailer: Mozilla 1.22KIT (Windows; I; 16bit) X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUBMWbHDky4NqrwXLNJAQF73gH/Q9rFuZAwZUKhcGOIR16t/GZHTlcmEWMK FFYti53ZDVl5SobojDEIVRa/aaHFgJXRIC+3QagiMyLAzMuN0P4spA== =liJk Originator: austern@isolde.mti.sgi.com