From -7787541166876703806
X-Google-Thread: f78e5,a10702d4a7db0a94
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news2.google.com!news1.google.com!news4.google.com!news.glorb.com!news.alt.net!comp-std-cpp-robomod!not-for-mail
From: "Lucas Galfaso" <lgalfaso@gmail.com>
Newsgroups: comp.std.c++
Subject: Re: Why no size_t to ::operator delete?
Date: Tue,  2 Jan 2007 08:59:28 CST
Organization: http://groups.google.com
Lines: 24
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <1167748819.184487.135760@v33g2000cwv.googlegroups.com>
References: <1167062648.523657.53620@a3g2000cwd.googlegroups.com>
   <memo.20061230111939.1648A@brangdon.cix.compulink.co.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Trace: posting.google.com 1167748824 5856 127.0.0.1 (2 Jan 2007 14:40:24 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 2 Jan 2007 14:40:24 +0000 (UTC)
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.csse.unimelb.edu.au: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Original-To: std-c++@mailman.ucar.edu
Delivered-To: std-c++@mailman.ucar.edu
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: v33g2000cwv.googlegroups.com; posting-host=200.123.147.90;
   posting-account=EiBFIA0AAABUIo4gheGArqTD1NeHjn3L
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
Xref: g2news2.google.com comp.std.c++:5216

Dave Harris wrote:
> lgalfaso@gmail.com (Lucas Galfaso) wrote (abridged):
> > Having that definition for an extra parameter for the global operator
> > delete would be really a bad idea; The key is when you delete a void*.
> > Say you have a pointer to a fundamental type, you cast it to void*, and
> > you delete the casted pointer; What would you expect to happen?
>
> That's already undefined behaviour, so anything can happen. The type
> used in the delete expression must match the type in the new expression.
>

Can you please point me to the specific section where it is stated that
this is undefined behavior. I am talking about a fundamental type, like
int, not a class, not even a POD.

Regards,
  Lucas Galfaso

---
[ 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.comeaucomputing.com/csc/faq.html                      ]



