array new-expressions: proposal

Martin von Loewis loewis at informatik.hu-berlin.de
Mon Jan 24 14:59:46 UTC 2000


> > PROPOSAL A.
> > 
> > No version of operator new[] is a special case.
[...]
> There is a reason that placement new is called _placement_ new:
> the intent was to allow the placement of objects and arrays at a 
> given address.  In effect, it's a way to specify a "this" pointer
> to a constructor.
> 
> So I think Proposal A is really not a good idea.

Why not? Under the proposal, it would have exactly the effect of
"specifying the 'this' pointer to a constructor". Of course, when you
create an array, you invoke more than one constructor, so you see more
than one 'this' pointer.

Under proposal A, the field elements are all allocated within the
specified space passed into the new expression. That's what you would
expect to happen, and that's what actually happens.

Regards,
Martin




More information about the cxx-abi-dev mailing list