get from tuple by type

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Mar 15 16:31:58 PDT 2015


Charles Cooper:

> Yes, I could say
> external_api1_react_to_event(event_t[1], event_t[0])
> .. but that is barbaric. It's a productivity sink because I 
> have to go back to the original definition, align the 
> arguments, and then context switch back to whatever I was 
> working on before.

If you are experiencing those problems it's probably the way 
D/Phobos to tell you to not use basic tuples for your purpose. 
Use tuples with named fields (or even structs).
Take also a look at Algebraic in std.variant.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list