This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Placement new[] weirdness
- To: jody at atdesk dot com, pooh at msu dot ru
- Subject: RE: Placement new[] weirdness
- From: mrs at wrs dot com (Mike Stump)
- Date: Thu, 15 Jul 1999 15:43:00 -0700
- Cc: egcs at egcs dot cygnus dot com
> 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?