array new-expressions: proposal
Christophe de Dinechin
ddd at cup.hp.com
Fri Jan 21 23:01:57 UTC 2000
Daveed Vandevoorde wrote:
>
> Matt Austern wrote:
> [...]
> > PROPOSAL A.
> >
> > No version of operator new[] is a special case.
> [...]
> > PROPOSAL B.
> >
> > ::operator new[](size_t, void*) is a special case. For that
> > version of operator new[] only, n1 = n * sizeof(T). We do not
> > store the number of elements in such an array anywhere.
>
> 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.
>
> Daveed
I sent a message to the -libraries mailing list. Although I agree with the
intent, there is also the question of how you expect people to delete[] it. If I
were to vote today, I'd agree with Daveed (and disallow delete[] on the result),
but I'm not sure enough though has been given to it.
Regards
Christophe
More information about the cxx-abi-dev
mailing list