Re: template with enum arg ?

2016-06-09 Thread chmike via Digitalmars-d-learn
This is awesome! I added it to my D cookbook. Thank you very much.

Re: template with enum arg ?

2016-06-08 Thread Ali Çehreli via Digitalmars-d-learn
On 06/08/2016 10:02 AM, chmike wrote: In a first implementation I defined a named enum in my class which I could use with my template function foo. final class Info { ... enum Value { info_1 = 1, ... } ... static bar(Value e) {...} } void foo(T)(T.Value e) { T.bar(e); }

template with enum arg ?

2016-06-08 Thread chmike via Digitalmars-d-learn
In a first implementation I defined a named enum in my class which I could use with my template function foo. final class Info { ... enum Value { info_1 = 1, ... } ... static bar(Value e) {...} } void foo(T)(T.Value e) { T.bar(e); } I could then write :