How'd I store possible types for each item of a list of Variants ?

2019-09-20 Thread oleobal via Digitalmars-d-learn
Hello, I'm writing a small parser for some command line app. A given command-line parameter can be of one of multiple types, so I thought I'd store this type information somewhere and make use of it in a function such as this: Algebraic!T parse(T...)(string s) { foreach(t; T) {

Re: How'd I store possible types for each item of a list of Variants ?

2019-09-20 Thread oleobal via Digitalmars-d-learn
Thanks for the help! On Friday, 20 September 2019 at 10:13:49 UTC, Ali Çehreli wrote: I don't understand everything here My bad, I guess once one spends too much time on a problem, it gets hard to explain. What if I put it this way ? TypedParameter!(ulong, int, string) p1 = new TypedPara

Re: How'd I store possible types for each item of a list of Variants ?

2019-09-20 Thread oleobal via Digitalmars-d-learn
On Friday, 20 September 2019 at 12:35:05 UTC, Andrea Fontana wrote: Is this ok for you: https://run.dlang.io/is/VllpJk ? This is great, thanks!