Re: anonymous template predicates

2015-04-30 Thread Idan Arye via Digitalmars-d-learn
On Thursday, 30 April 2015 at 21:01:36 UTC, Vlad Levenfeld wrote: I was wondering if there's a mechanism to make anonymous templates, e.g. given: enum Policy {A, B} alias List = TypeTuple!(...); instead of this: enum has_policy_A (T) = T.policy == Policy.A; alias Result = Filter!(has_

anonymous template predicates

2015-04-30 Thread Vlad Levenfeld via Digitalmars-d-learn
I was wondering if there's a mechanism to make anonymous templates, e.g. given: enum Policy {A, B} alias List = TypeTuple!(...); instead of this: enum has_policy_A (T) = T.policy == Policy.A; alias Result = Filter!(has_policy_A, List); use something like this: Filter!(T => T.policy