Re: Fastest way to check if a predicate can take a single parameter of a specific type

2019-10-11 Thread Paul Backus via Digitalmars-d-learn
On Friday, 11 October 2019 at 09:05:25 UTC, Per Nordlöw wrote: I want to check whether auto _ = pred(T.init); static assert(is(typeof(_) == bool)); compiles or not. Which one __traits(compiles, { auto _ = pred(T.init); static assert(is(typeof(_) == bool)); }) and is(typeof

Fastest way to check if a predicate can take a single parameter of a specific type

2019-10-11 Thread Per Nordlöw via Digitalmars-d-learn
I want to check whether auto _ = pred(T.init); static assert(is(typeof(_) == bool)); compiles or not. Which one __traits(compiles, { auto _ = pred(T.init); static assert(is(typeof(_) == bool)); }) and is(typeof(pred(T.init)) == bool) is preferred compilation performance-wi