C++ vs D aggregates

Timon Gehr timon.gehr at gmx.ch
Sun Dec 4 07:04:26 PST 2011


On 12/04/2011 12:00 PM, Kagamin wrote:
> Dejan Lekic Wrote:
>
>> Do D2 aggregates behave the same, or are there notable differences?
>
> D restricts usage to static initializers only, C++ doesn't have this limitation.

This works:

struct S{int x;}

void main(){
     int a;
     S x = {a};
}

What does not?


More information about the Digitalmars-d-learn mailing list