Topic: Contradiction on operator delete in Jan'96 DWP
Author: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson)
Date: 1996/04/08 Raw View
{ Note followups to comp.std.c++. -mod clc++m }
oliva@dcc.unicamp.br (Alexandre Oliva) writes:
>Section 5.3.4 [expr.new] of the Jan'96 DWP states:
Articles like this should be posted to comp.std.c++ rather than
comp.lang.c++.moderated. I've crossposted and redirected followups there.
>19A declaration of placement operator delete matches the declaration of
> a placement operator new when it has the same number of parameters and
> all parameter types except the first are identical disregarding top-
> level cv-qualifiers.
>
>This seems to imply that operator delete may be overloaded, and may
>have as many formal arguments as desired.
Yes, that's right.
>However,
>
>Section 3.7.3.2 [basic.stc.dynamic.deallocation] states:
>
>2 Each deallocation function shall return void and its first parameter
> shall be void*. For class member deallocation functions, a second
> parameter of type size_t (_lib.support.types_) may be added. If both
> versions are declared in the same class, the one-parameter form is the
> usual deallocation function and the two-parameter form is used for
> placement delete (_expr.new_). If the second version is declared but
> not the first, it is the usual deallocation function, not placement
> delete.
>
>This seems not to allow those matching operator delete's to be
>declared.
You are misinterpreting this paragraph. It does not prohibit overloading
operator delete, or using as many formal arguments as desired.
(Which sentence in the above paragraph did you think prohibited
declaring those matching `operator delete's?)
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.
[ 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 ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]