🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: an optimization I claim is illegal

#2599
From: Steve Clamage
Date: Fri, 17 Nov 1995 01:02
28 lines
1487 bytes
In article h00@engnews1.eng.sun.com, clamage@Eng.Sun.COM (Steve Clamage) writes:
>
>
>If we assume that the VALUE of p does not change, the question is whether
>the object it points to can change type (except during construction and
>destruction). I think the answer is no, in which case the optimization is valid.

I meant to say:

The question is whether an object can change type during execution of a
member function other than during construction or destruction.

You can allocate raw storage, construct an object in it, destroy the
object, and construct a new object of different type at the same location.
The key point is whether you can do that during execution of a member
function on behalf of the original object.

I think the answer is no.
---
Steve Clamage, stephen.clamage@eng.sun.com



---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <48gmat$i43@engnews1.eng.sun.com>
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
References: <48ge05$h00@engnews1.eng.sun.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
From: clamage@Eng.Sun.COM (Steve Clamage)
Newsgroups: comp.std.c++
Subject: Re: an optimization I claim is illegal
Date: 17 Nov 1995 01:02:43 GMT
Organization: Sun Microsystems Inc.
Approved: matt@physics2.Berkeley.EDU (Matt Austern)
Message-ID: <48gmat$i43@engnews1.eng.sun.com>
References: <48ge05$h00@engnews1.eng.sun.com>
Reply-To: clamage@Eng.Sun.COM
NNTP-Posting-Host: physics2.berkeley.edu