generic array functions and vector operations
Steven Schveighoffer
schveiguy at yahoo.com
Mon Aug 18 13:02:51 PDT 2008
"Walter Bright" wrote
> 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)
> ...
What if you just wanted to use static arrays for the non-heap performance
benefits (and value semantics)?
-Steve
More information about the Digitalmars-d
mailing list