generic array functions and vector operations

Walter Bright newshound1 at digitalmars.com
Mon Aug 18 12:38:51 PDT 2008


Bent Rasmussen wrote:
> I wanted to test out array operations and create some nice generic 
> functions for dealing with vectors. One function is defined as
> 
> A[n] lerp(A, uint n)(A t, A[n] a, A[n] b)
> {
>    return a[] + t * (b[] - a[]);
> }

Just write it as:

A[] lerp(A)(A t, A[] a, A[] b)
   ...



More information about the Digitalmars-d mailing list