I'm sorry, but this is unacceptable (union members and ctors)
Andrew Pinski
pinskia@gmail.com
Sat Jun 16 19:21:00 GMT 2007
On 6/16/07, michael.a <wild.eyed.boy.from.freecloud@gmail.com> wrote:
>
> As for "placement new", from what I can find, it is unsafe to use with any
> memory that isn't part of the heap.
Huh????? It can be used with stack variables, we have tests in the
testsuite where we use it with such.
> As for the discussion of unions, placement new is way too much overhead.
placement new has no overhead, that is by design. I literally mean
placement new does nothing except for changing the dynamic type and
calling the constructor. Where is the overhead there? I see unions
having more overhead than placement new as unions are not as well
optimized.
-- Pinski
More information about the Gcc
mailing list