WTF did happen with struct constructor and ref in 2.061 ?

Sönke Ludwig sludwig at outerproduct.org
Sat Jan 5 13:23:11 PST 2013


Am 04.01.2013 20:35, schrieb deadalnix:
> On Friday, 4 January 2013 at 19:15:03 UTC, Ali Çehreli wrote:
>> > This may not have a storage :
>> > foo(funcThatReturnsS());
>>
>> I don't see that. funcThatReturnsS returns an S, which must have a storage as well.
>>
> 
> This is where things are subtle. Depending on the calling convention, the struct may be returned
> into a register. In such case it has no storage in memory.
> 

Although, nothing stops the compiler from initializing a struct in a register either. At least when
the constructor can be inlined.



More information about the Digitalmars-d mailing list