Article View: comp.std.c++
Article #3151Re: Why no allocator-specific delete?
From: eddy Gorsuch
Date: Thu, 25 Jan 1996 20:12
Date: Thu, 25 Jan 1996 20:12
37 lines
2287 bytes
2287 bytes
In article <4e0u1s$5fv@engnews1.Eng.Sun.COM>,
Steve Clamage <clamage@Eng.Sun.COM> wrote:
[...]
>No good syntax was found for such. The obvious syntax
> delete (x) p;
>leads to too many ambiguities. More importantly, it means that the
>point of deletion would somehow have to know what placement version
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>of "new" was used and what the parameters were. Needing that knowledge
>would make "placement delete" unsafe and hard to use. (Consider the
>general case where the "new" and "delete" expressions are in different
>compilation units, and the parameters to "new" affect how "delete"
>should be called.)
[...]
>>but there is no matching version of 'delete'? Are we supposed to use both
>>destroy() and deallocate() to get rid of that object?
>
>Yes. In the above example:
> p->~T();
> operator delete(p, x);
^^^^^^^^^^^^^^^^^^^^^^
On the one hand you are saying that a placement syntax would make the point
of deletion know what placement version of new was used, then you show the
proper way to delete an object created with placement new that requires that
same knowledge, but one of your arguments is that this knowledge is bad.
eddy
--
ed.dy \'ed-e-\ n [ME (Sc dial.) ydy, prob. fr. ON itha; akin to OHG ith-
again], L et and 1a: a current of water or air running contrary to the main
current; esp)X : a small whirlpool 1b: a substance moving similarly 2: a
contrary or circular current - eddy vb
[ 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:
<4e8kac$j9h@eclipse.eng.sc.rolm.com>Path:
arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamageReferences:
<4dvid8$460@news.bridge.net> <4e0u1s$5fv@engnews1.Eng.Sun.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage From: eddy@siemensrolm.com (eddy Gorsuch) Newsgroups: comp.std.c++ Subject: Re: Why no allocator-specific delete? Date: 25 Jan 1996 20:12:13 GMT Organization: Siemens Rolm Communications Inc. Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <4e8kac$j9h@eclipse.eng.sc.rolm.com> References: <4dvid8$460@news.bridge.net> <4e0u1s$5fv@engnews1.Eng.Sun.COM> NNTP-Posting-Host: taumet.eng.sun.com Content-Type: text Content-Length: 1496 X-Lines: 33 Originator: clamage@taumet