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

Reply via email to