From 328117077554603155
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,8017beb93f8fbefc
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-06-14 13:34:00 PST
Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: "Igor A. Goussarov" <igusarov@akella.com>
Newsgroups: comp.std.c++
Subject: Re: Incomplete types
Date: Thu, 14 Jun 2001 20:33:39 GMT
Organization: Akella
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <3B290321.7683204C@akella.com>
References: <3B250752.99C15516@akella.com> <3B253155.D66B49E5@spamcop.net> <3B26648E.39F5202@akella.com> <3B268F1D.81DA398E@spamcop.net>
X-Trace: mail2news.demon.co.uk 992550823 mail2news:6172 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=koi8-r
Content-Transfer-Encoding: 7bit
NNTP-Posting-Date: 14 Jun 2001 18:29:59 GMT
X-Accept-Language: ru,en
Lines: 43
Xref: archiver1.google.com comp.std.c++:6115

Ron Natalie wrote:
> This is the part I do not understand.  You can't codify the old behavior
> because you don't know what it was to begin with.  How is the spec going
> to read.
[...]
> That's my point.  I don't think we need to invent new ways for people
> to invoke undefined behavior.  There are plenty others in the standard if
> you close this hole.

   I see. Actually, I didn't want undefined behaviour for deleting a
void*, instead I wanted it to be equivalent to deallocation of the
memory. Look, one can construct the object like

Foo*    p = new Foo;

and one can do it this way

char*   tmp = new char[sizeof(Foo)];
Foo*    p = new(tmp) Foo;

   So you see that at object constuction there's an ability to make
memory allocation and actual object constuction in two separate steps.
   The same holds true for the destruction (type of destruction
corresponds to the type of construction):

delete p;

vs.

p->~Foo();
delete[] reinterpret_cast<char*>(p);

So what I wanted delete void* to be is a merely memory deallocation like
in the last example.

Igor

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



