"cannot deduce function from argument types" issue.
ted via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Feb 10 01:09:18 PST 2015
Ali Çehreli wrote:
> On 02/10/2015 12:31 AM, ted wrote:
>
> > ElementType!R testFunc(R)( R range, ElementType!R foo) //
compiles
> > with double foo
>
> If think it is a little too much to ask from the template system of D. A
> proper way of doing the same thing is to use a template constraint:
>
> ElementType!R testFunc(R, E)( R range, E foo)
> if (is (E : ElementType!R))
>
> Ali
....thanks !
More information about the Digitalmars-d-learn
mailing list