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 : foo(Info.Value.info_1); I would prefer to write : foo(Info.info_1);If I change the enum into an anonymous enum the template doesn't work anymore.
How could I solve this ? Also, do I need a template argument filter if() ?