Re: MemberDefaults trait

2017-03-14 Thread Ali Çehreli via Digitalmars-d-learn
On 10/10/2016 04:50 PM, Ali Çehreli wrote: > Could you please review the following template to see whether it makes > sense. It produces an AliasSeq type consisting of the default values of > the members of a struct. It should and does support members that are > initialized with '= void'. I could

Re: MemberDefaults trait

2016-10-10 Thread Ali Çehreli via Digitalmars-d-learn
On 10/10/2016 04:50 PM, Ali Çehreli wrote: > static if (!is(T == struct)) { > static assert(T.stringof ~ " is not a struct type"); > } Wow! That's a nice brain fart on my part. Ok, I can fix that one... :) Ali

MemberDefaults trait

2016-10-10 Thread Ali Çehreli via Digitalmars-d-learn
Could you please review the following template to see whether it makes sense. It produces an AliasSeq type consisting of the default values of the members of a struct. It should and does support members that are initialized with '= void'. I could not achieve this with std.traits or __traits.