This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: operator new/delete forwarding


Howard Hinnant wrote:
On Jul 20, 2006, at 3:57 PM, Martin Sebor wrote:

Howard Hinnant wrote:
[...]

I view this forwarding as a valuable convenience to the client, however I believe it is incomplete, and slightly wrong. I respectfully propose the following slight alteration:


This makes sense but I wonder why the standard doesn't specify
the nothrow operators just the way you describe instead of going
through the same steps as for the ordinary forms and using the
"as if" phrase? It almost looks like the intent was for both
operators to be implemented in terms of the same (unspecified)
function but not by calling each other, i.e., like so (calling
new_handler omitted):
[...]
I think the standard allows either implementation. Imho the one I outlined is higher quality. I brought this issue up a long time ago with the LWG:

http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-closed.html#206

Hmm, but the Rationale for closing this issue as NAD was that [the possibility that the operators would become unlinked] was by design. Doesn't that mean that it's a deliberate feature for users to be able to replace one without causing the other to be replaced as well?

Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]