`__traits(isSame)` only works for symbol equality, not work for type equality. So you should use `if(!is(T == bool))` in template constraint.