Can you introspect predicate arity and if it's an equality predicate?

Seb seb at wilzba.ch
Fri Jan 12 10:55:53 UTC 2018


On Friday, 12 January 2018 at 00:16:07 UTC, aliak wrote:
> Hi, so basically is there a way to:
>
> void func(alias pred = null, Range)(Range range) {
>   // 1) check if pred(ElementType!Range.init, 
> ElementType!Range.init) is equality
>   // 2) check if isUnary!pred
>   // 3) check if isBinary!pred
> }
>
> [...]

It isn't possible yet, but will be very soon: 
https://github.com/dlang/dmd/pull/7484




More information about the Digitalmars-d-learn mailing list