Article View: comp.std.c++
Article #3122Re: Why no allocator-specific delete?
From: John Max Skaller
Date: Fri, 26 Jan 1996 19:23
Date: Fri, 26 Jan 1996 19:23
33 lines
2109 bytes
2109 bytes
Matt Timmermans wrote: > Yes, and this is very annoying. The lack of a placement-delete makes > placement-new nearly useless. I can't, in fact, think of a single way that > placement-new could be used properly. > > The lack of a placement-delete is on of the many factors in C++ conspiring > to make it absolutely impossible to make generic collections that hold > actual objects (with constructors) instead of just pointers. With all due repsect please examine STL carefully. Who needs "delete"? With STL, deallocation of storage and destruction of an object are separable. If you don't like "delete", just don't use it. The same applies to "new" -- the ONLY form of new that is necessary is the standard placement form, because that is the way to create an object in a specified storage location. So that, too, allows separation of construction and allocation. With your own deallocation functions, you can do whatever overloading you want. So what is the problem? -- John Max Skaller voice: 61-2-566-2189 81 Glebe Point Rd fax: 61-2-660-0850 GLEBE NSW 2037 web: http://www.maxtal.com.au/~skaller/ AUSTRALIA email: skaller@maxtal.com.au --- [ 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:
<31090045.26D7@suphys.physics.su.oz.au>Path:
arc1-ca.pugleaf.net!in2.uu.net!bounce-backReferences:
<4dvid8$460@news.bridge.net> <4e0u1s$5fv@engnews1.Eng.Sun.COM> <4e85k6$b04@noc.tor.hookup.net>Show Full Headers
Complete Article Headers
From: John Max Skaller <maxtal@suphys.physics.su.oz.au> Message-ID: <31090045.26D7@suphys.physics.su.oz.au> X-Original-Date: Sat, 27 Jan 1996 02:24:37 +1000 Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back Date: 26 Jan 96 19:23:01 GMT Approved: fjh@cs.mu.oz.au Newsgroups: comp.std.c++ Subject: Re: Why no allocator-specific delete? Organization: MAXTAL References: <4dvid8$460@news.bridge.net> <4e0u1s$5fv@engnews1.Eng.Sun.COM> <4e85k6$b04@noc.tor.hookup.net> X-Mailer: Mozilla 2.0b6a (WinNT; I) X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMQkqIOEDnX0m9pzZAQEyhgF7B/We4ho5rd4Wv+ukxknBOi3s503mSloz QmO86xTGcZcm/oHk37+stVMbhR6s6ds4 =vFgN