The code you were trying to write:

struct Foo(T) {
    T t;
}

void main() {
    import std.stdio, std.algorithm, std.array;

    float[] vals = [1.1, 2.1, 3.1, 4.1];
    auto arr = vals.map!(Foo!float).array;
    arr.writeln;
}

Sorry, my example had an unneeded template. Simply this (and also your code)
---
struct S
{
    float f;
}
---
still results in an undefined identifier.

Reply via email to