From -9135215864230405456
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,24c0140d54165625
X-Google-Attributes: gidf78e5,public
From: Ron Natalie <ron@sensor.com>
Subject: Re: a question about temporary exception object
Date: 1998/11/07
Message-ID: <36435240.2BC5E3C5@sensor.com>#1/1
X-Deja-AN: 409368973
Content-Transfer-Encoding: 7bit
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
References: <3642A62C.CF2FC315@ccnet.com>
X-Original-Date: Fri, 06 Nov 1998 14:47:12 -0500
Content-Type: text/plain; charset=us-ascii
Organization: Sensor Systems
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUANkRmWuEDnX0m9pzZAQE22AGAkJ/VJBwXj1OZVCGHUPTMdfzij7KVpmwL 2IsgOjJN1gvnKfipDZlleRYl1MwZQtfK =PGe+
Mime-Version: 1.0
Newsgroups: comp.std.c++

> 
> I experimented with VC++6.0.  In both cases, the constructor was called
> once, but the destructor was called twice.  Did I do something wrong or
> is the compiler simply broken?
> 

I'm only running VC++ 5, but is it perhaps that you forgot
to put a print in your copy constructor?  I compiled your
test with my own Foo class with prints in the constructors
and destructors and got this:


Foo()
CAUGHT
~Foo()
Foo()
Foo(Foo&)
CAUGHT
~Foo()
~Foo()
---
[ 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://reality.sgi.com/austern_mti/std-c++/faq.html              ]



