How get struct value by member name string ?

John Xu 728308756 at qq.com
Mon May 29 09:35:11 UTC 2023


I saw ddbc 
(https://github.com/buggins/ddbc/blob/master/source/ddbc/pods.d) 
uses

     static if (__traits(compiles, (typeof(__traits(getMember, T, 
m))))) {
         __traits(getMember, T, m)
     }

But for my experience, above code sometimes/somewhere works, 
sometimes/somewhere just doesn't:

     Error: variable `column` cannot be read at compile time

Is there any friend can explain some more details?


More information about the Digitalmars-d-learn mailing list