std.range.ElementType应该如何在模板约束中使用?
我是这样想的,但我错了
import std.range;
auto f(T)(T x)
if (ElementType!(T) is uint) // adding this line causes lot of error messages
// first of which is: found ')' when expecting '.' following uint
{
return x;
}
f(map!"a"([1,2,3,4]));