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


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

RE: Placement new[] weirdness


> 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?


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