On Wednesday, 16 March 2016 at 17:08:20 UTC, Johan Engelen wrote:
On Wednesday, 16 March 2016 at 11:47:35 UTC, QAston wrote:
import std.meta;
template isBool(U)() = is(U == bool);
static if (!allSatisfy!(isBool, T)) {
return true; // no longer emits a warning
}
Something like this should work.
Thanks, but:
On Wednesday, 16 March 2016 at 11:18:36 UTC, Johan Engelen
wrote:
(I have heavily simplified the real-world code, please don't
discuss alternative solutions to the "is(U==bool)" in
particular. For sake of argument, assume that the predicate is
a complicated beast.)
This method will work regarless of the predicate, just check if
the predicate isn't matched for the whole array using
allSatisfy/anySatisfy.