From 4479982011480924491
X-Google-Thread: f78e5,a10702d4a7db0a94
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII
Path: g2news2.google.com!news1.google.com!news.maxwell.syr.edu!wns13feed!worldnet.att.net!207.14.113.41!news.alt.net!comp-std-cpp-robomod!not-for-mail
From: "James Kanze" <james.kanze@gmail.com>
Newsgroups: comp.std.c++
Subject: Re: Why no size_t to ::operator delete?
Date: Mon,  1 Jan 2007 13:40:50 CST
Organization: http://groups.google.com
Lines: 38
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <1167679861.834723.300430@i12g2000cwa.googlegroups.com>
References: <12omt8jit7rl379@corp.supernews.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1167679867 32312 127.0.0.1 (1 Jan 2007 19:31:07 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 1 Jan 2007 19:31:07 +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 (X11; U; Linux x86_64; en-US; rv:1.8.0.7) Gecko/20060802 Mandriva/1.5.0.7-0.1.20060mdk (2006.0) Firefox/1.5.0.7,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: i12g2000cwa.googlegroups.com; posting-host=86.70.189.126;
   posting-account=uN4QgA0AAAC_qk3WofNKjyjXNSBMXL2b
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
X-MIME-Autoconverted: from quoted-printable to 8bit by mulga.csse.unimelb.edu.au id l01JVG18021383
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
Xref: g2news2.google.com comp.std.c++:5212

Scott Meyers wrote:
> I can imagine specifying the global operator delete like this:

>    void operator delete(void *p, size_t sz);

> such that an expression "delete E" that ultimately yields a call to
> ::operator delete would pass sz as follows:
> - For an expression E of class type, the same value that'd be passed to
>    typeof(E)::operator delete taking a size_t.
> - For an expression E of non-class type T, sizeof(T).
> - For an expression E of type void*, 0 (zero), meaning "size unknown".

> Can someone explain to me why having the "normal" operator delete take a
> size_t is impractical?

I don't know that it's impractical.  But the implementation must
provide one signature, and it must be fixed, if you are to be
allowed to replace it.  (Otherwise, how would you know the
signature that needed to be replaced.)  The signature chosen was
the one without the second parameter.

The situation in the case of a class specific operator delete is
somewhat different, in that you are defining a new function,
which doesn't exist otherwise.

--
James Kanze (Gabi Software)            email: james.kanze@gmail.com
Conseils en informatique orient�e objet/
                   Beratung in objektorientierter Datenverarbeitung
9 place S�mard, 78210 St.-Cyr-l'�cole, France, +33 (0)1 30 23 00 34


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



