Andrew Pinski-2 wrote:
> 
> Huh?????  It can be used with stack variables, we have tests in the
> testsuite where we use it with such.

Thats not what google told me, I believe from every source I took a look at.



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

I'm sorry, but "placement new" does really one thing nice. Its not terribly
suited to this situation. Hence why it would come with a high overhead as
far as code intelligibility(scalability) is concerned, and would likely
prevent inline optimizations if used in the only way I can think of as far
as the situation at hand is concerned, as I described in another post.

Bottom line, placement new is cool, and I'm glad I am more aware of it now.
But its not going to remedy this matter, or even a subset of its
ramifications. Bottom line is whatever the solution, it would have to not
mean rewriting any code outside the class definitions themselves... and
placement new isn't going to get you there, even if it is safe to use
outside the heap on all platforms/implimentations.

-- 
View this message in context: 
http://www.nabble.com/I%27m-sorry%2C-but-this-is-unacceptable-%28union-members-and-ctors%29-tf3930964.html#a11157334
Sent from the gcc - Dev mailing list archive at Nabble.com.

Reply via email to