Test the return type of 'unaryFun' and 'binaryFun'.
Mek101
oidgemek101 at gmail.com
Thu Aug 29 20:14:47 UTC 2019
I made the following enumerations to test the predicates.
>private enum bool isUnaryPredicate(alias pred, Range) =
>is(typeof(unaryFun!(pred)((ElementType!Range).init)) == bool);
>private enum bool isBinaryPredicate(alias pred, Range, V) =
>is(typeof(binaryFun!(pred)((ElementType!Range).init, V.init)) ==
>bool);
Both work as expected. Thank you.
More information about the Digitalmars-d-learn
mailing list