array new-expressions: proposal

John Wilkinson jfw at cthulhu.engr.sgi.com
Mon Jan 24 18:01:13 UTC 2000


Jason Merrill wrote:
> 
> It's really a question of which is more common: people wanting to delete[]
> pointers from placement new, or people wanting placement new to return the
> same pointer.  I believe that the latter is more common.  At least, I've
> heard from some such people, whereas I have heard from nobody in the former
> category.
> 
> Matt:  Why not just say
> 
>   padding = max (sizeof (size_t), alignof (T))
> 
> ?  I don't see any reason to mention long double by name, and I don't
> see much of a reason to treat char specially, either.  Are there any
> alignment constraints on 'new char' in the standard?
> 
> Jason

I agree with most of what Jason says here.  I have, however, had
customer complaints about not being able to delete[] pointers returned
by placement new, but these referred to user-defined placement new. 

The standard does impose special restraints on new char[], as I believe
Matt pointed out.  That's the reason for the extra complexity.


-- 
John Wilkinson




More information about the cxx-abi-dev mailing list