On Thursday, 9 February 2017 at 15:00:21 UTC, angel wrote:
On Thursday, 9 February 2017 at 14:39:41 UTC, angel wrote:
On Thursday, 9 February 2017 at 13:30:07 UTC, jkpl wrote:
I'm looking for a better way to do this, if possible:
Or actually, maybe this will suite your case better:
```
On Thursday, 9 February 2017 at 14:39:41 UTC, angel wrote:
On Thursday, 9 February 2017 at 13:30:07 UTC, jkpl wrote:
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 =
On Thursday, 9 February 2017 at 13:30:07 UTC, jkpl wrote:
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;
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 ==