To be more precise the code below doesn't compile :

struct Vector(T, uint N)
{
        alias T type;
        enum dimension = N;
        T data[N];
}

void func(V, V.type def_val) (uint i, V v)
{
        if (i < v.dimension) {
                v.data[i] = def_val;
        }
}

void main()
{
        alias Vector!(int, 3) Vec3i;
        Vec3i v;
        func!(Vec3i, 42)(2, v);
}

With the error message :

test.d(8): Error: no property 'type' for type 'V'
test.d(8): Error: V.type is used as a type


Reply via email to