I have used std.algorithm.canFind with different tuple types by mistake, and the compiler has not complained. So to show it I have written some reduced code that uses just numbers:

import std.algorithm: canFind;
void main() {
    int[] arr1 = [1, 2];
    double x1 = 2.0;
    assert(arr1.canFind(x1));
    double[] arr2 = [1.0, 2.0];
    int x2 = 2;
    assert(arr2.canFind(x2));
}


Are both of those canFind calls acceptable?

Bye,
bearophile

Reply via email to