DMD 0.177 release

Lutger lutger.blijdestijn at gmail.com
Tue Dec 12 08:00:10 PST 2006


Pragma wrote:
> Foo f = Foo(1,2,3);
> 
> That's better, but look at what's really happening here.  Inlining and 
> compiler optimization aside, the 'constructor' here creates a Foo on the 
> stack which is then returned and *copied* to the destination 'f'.

About this optimization business, is this an issue? Since Walter stated 
that such copies are optimized away (trivially?), my assumption was that 
the syntax as it is now relies on this optimization being present. Or to 
put it in other words, static opCall would not be supported if there was 
no such optimization possible.
Perhaps it is similar to how the use of functors with templates in C++ 
rely on inlining, STL would be so slow without such optimizations.

My question is if it is reasonable to make this assumption or can you 
put compiler optimization aside?



More information about the Digitalmars-d-announce mailing list