This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Placement new[] weirdness
- To: (Mike Stump) <mrs at wrs dot com>
- Subject: RE: Placement new[] weirdness
- From: Andrey Slepuhin <pooh at msu dot ru>
- Date: Fri, 16 Jul 1999 03:08:03 +0400 (MEDT)
- Cc: egcs at egcs dot cygnus dot com, jody at atdesk dot com
- Organization: Moscow State University Network (MSUnet)
On 15-Jul-99 Mike Stump wrote:
>> Date: Fri, 16 Jul 1999 02:04:35 +0400 (MEDT)
>> From: Andrey Slepuhin <pooh@msu.ru>
>> To: Jody Hagins <jody@atdesk.com>
>> Cc: egcs@egcs.cygnus.com
>
>> I'm worrying because according 5.3.4 placement operator new[] needs
>> implementation-defined amount of additional storage to save a size
>> of array. So if I want to create an array of e.g. 5 elements of class T
>> using placement new[], I need to have a peace of 5*sizeof(T)+<some_constant>
>> bytes, where <some_constant> is implementation defined and is unknown at
>> compile time.
>
> Ah, so then you want to go ask in comp.std.c++ why they did it this
> way and what use could it be? I tend to think this may have been the
> wrong choice and that y should be mandated to be 0. I tend to think
> that is the direction I would take the compiler. There is no way to
> call placement delete, other than within the new call, so there is no
> harm in not storing the value. I think that is what was intended.
>
> Did I miss anything?
Probably no.