如何在D中与数组相交?

Dmi*_*kov 1 arrays d

我需要找到D.串的两个阵列之间差异的问题,我无法理解如何使用SetDifferencestd.algorithm.

    auto x = SetDifference(filearr1,filearr2);
Run Code Online (Sandbox Code Playgroud)

得到错误:

Error: struct std.algorithm.SetDifference cannot deduce function from argument types !()(string[], string[]), candidates are:

Mar*_*ütz 5

使用setDifference小写的"s".

SetDifference是返回的类型的名称setDifference,恰好是模板结构.编译器不能自动从结构中确定模板参数,只能从函数调用中确定,这就是为什么大多数模板结构存在辅助函数的原因.