I'm looking for a better way to do this, if possible:

```
class Tool
{
    string name;
}

T namedTool(alias Variable, T)()
{
    T result = new T;
    result.name = Variable.stringof;
    return result;
}

void main()
{
    Tool grep;
    grep = namedTool!(grep,Tool);
    assert(grep.name == "grep");
}
```

Ideally this would work like this:

```
Tool grep = namedTool!Tool;
assert(grep.name == "grep");
```

Possible ?

Reply via email to