www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Function Templates with Only Template Parameters and UFCS

Given the code:

```
auto foo(alias A, string str)()
{
     // do stuff
}

struct Bar
{
     // members
}

Bar bar;
bar.foo!"hello"; // This is an error. Would have to do foo!(bar, 
"hello")
```

Assuming that I haven't misunderstood or borked something, having 
UFCS for function templates whose parameters are only for the 
template would, seemingly, be nice. Are there workarounds? Is it 
possible to implement, and possibly the more important question, 
is it a good idea? One downside is there would be more ambiguity 
when one is parsing that last line.
May 10 2020