opDispatch

Danny via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 25 08:24:08 PST 2014


Adam: Thanks, that was very illuminating! I tried and these work 
indeed.

Is there a function like opDispatch which can be used (at compile 
time) to refer to something by name whether or not it's custom? 
(to access something like "value.a" safely. mixin and string 
concatenation looks like would have problems with special 
characters easily)

(Something like getattr(x, "a") in Python)


More information about the Digitalmars-d-learn mailing list