🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: overloading global new and delete

#2279
From: Fergus Henderson
Date: Sun, 22 Oct 1995 07:12
31 lines
1953 bytes
clamage@Eng.sun.com (Steve Clamage) writes:

>The strstream functions must use the global operator
>new and operator delete. Appendix D of the draft standard makes this clear.

Ah yes, right you are.  My earlier post stating that the standard didn't
say anything about strstream was wrong.  (Silly me, I didn't think that
deprecated features would be in the Annex titled "Future Directions"!
I guess I'll know to look harder next time ;-)

One more point though: the example program overloaded only `operator new'
and `operator delete'; it did not overload the array forms `operator new []'
and `operator delete []'.  Although the draft standard says that the
default behaviour of `operator new [] (size_t size)' is just to call
`operator new(size)', it does *not* say that the default behaviour of
`operator delete[] (void *p)' is to call `operator delete (p)'.
Instead it just says that it "reclaims [the] storage", without
specifying how.  [See 18.4.2.1.]  From this I conclude that it is
unspecified whether or not the replacement `operator delete' function
in the example program would get called.

-- 
Fergus Henderson             	WWW: http://www.cs.mu.oz.au/~fjh
fjh@cs.mu.oz.au              	PGP: finger fjh@128.250.37.3


---
[ 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: <9529510.24924@mulga.cs.mu.OZ.AU>
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!Matt
References: <45js9r$iuq@hackberry.zilker.net> <45mbfb$9oc@engnews2.Eng.Sun.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!Matt
From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
Newsgroups: comp.std.c++
Subject: Re: overloading global new and delete
Date: 22 Oct 1995 07:12:22 GMT
Organization: Computer Science, University of Melbourne, Australia
Approved: Matt@Austern
Message-ID: <9529510.24924@mulga.cs.mu.OZ.AU>
References: <45js9r$iuq@hackberry.zilker.net> <45mbfb$9oc@engnews2.Eng.Sun.COM>
NNTP-Posting-Host: austern.hip.berkeley.edu