Phobos Members-Tuple function?
Timon Gehr
timon.gehr at gmx.ch
Sat Jan 19 21:59:17 PST 2013
On 01/20/2013 04:55 AM, F i L wrote:
> Ali Çehreli wrote:
>> The following program produces this output:
>>
>> [...code...]
>
> Awesome! Thanks, I wasn't expecting it to actually be as easy as that. I
> tried all sort of difference combinations with __traits(allMembers, ..)
> but it looks like I just needed to move it into the foreach loop itself.
> I wounder why there's a difference when assigning to an enum...
foreach over an enum constant is not magically unrolled statically like
foreach over a sequence ("TypeTuple") is.
(The somewhat related fact that static foreach over a sequence of enum
values does not work is a compiler bug.)
More information about the Digitalmars-d-learn
mailing list