Function Templates with Only Template Parameters and UFCS

Seven Seas seven.seas at email.email
Sun May 10 21:47:56 UTC 2020


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.




More information about the Digitalmars-d-learn mailing list