[Issue 1386] "string expected" when using allMembers-element in __traits(getMember, ...)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 2 05:45:26 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=1386


Simen Kjaeraas <simen.kjaras at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simen.kjaras at gmail.com


--- Comment #7 from Simen Kjaeraas <simen.kjaras at gmail.com> 2010-01-02 05:45:23 PST ---
As a way to index allMembers as a tuple, here's a template converting an array
known at compile time to a tuple:

template ArrayToTuple( alias Arr, U... ) {
    static if ( Arr.length ) {
        alias ArrayToTuple!( Arr[ 0..$-1 ], Arr[ $-1 ], U ) ArrayToTuple;
    } else {
        alias U ArrayToTuple;
    }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list