Re: Template arg deduction

2021-07-07 Thread vit via Digitalmars-d-learn
On Wednesday, 7 July 2021 at 19:14:52 UTC, Kevin Bailey wrote: I'm trying to use some fairly simple template argument deduction, but maybe I'm not getting the syntax correct. C++ doesn't event blink at something like this, but D is giving me: temptest.d(18): Error: template temptest.func canno

Re: Template arg deduction

2021-07-07 Thread Tejas via Digitalmars-d-learn
On Wednesday, 7 July 2021 at 19:14:52 UTC, Kevin Bailey wrote: I'm trying to use some fairly simple template argument deduction, but maybe I'm not getting the syntax correct. C++ doesn't event blink at something like this, but D is giving me: temptest.d(18): Error: template temptest.func canno

Re: Template arg deduction

2021-07-07 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 7 July 2021 at 19:14:52 UTC, Kevin Bailey wrote: I'm trying to use some fairly simple template argument deduction, but maybe I'm not getting the syntax correct. C++ doesn't event blink at something like this, but D is giving me: temptest.d(18): Error: template temptest.func canno

Re: Template arg deduction

2021-07-07 Thread Ali Çehreli via Digitalmars-d-learn
On 7/7/21 12:14 PM, Kevin Bailey wrote: > fairly simple template argument deduction It's not the simplest but it is still complicated. :) > I guess D can't crack open a type like that? There are other ways of achieving the same thing the simplest of which is probably the following: void fun

Template arg deduction

2021-07-07 Thread Kevin Bailey via Digitalmars-d-learn
I'm trying to use some fairly simple template argument deduction, but maybe I'm not getting the syntax correct. C++ doesn't event blink at something like this, but D is giving me: temptest.d(18): Error: template temptest.func cannot deduce function from argument types !()(bar), candidates are: