generic array functions and vector operations

Bent Rasmussen IncredibleShrinkingSphere at Gmail.com
Mon Aug 18 10:51:40 PDT 2008


"Steven Schveighoffer" <schveiguy at yahoo.com> skrev i meddelelsen 
> missing feature.  It is a (commonly annoying) limitation of the D spec.
> 
> To get around it, you can return a struct with the array inside.
> 
> struct StaticArray(T, uint n)
> {
>   T[n] value;
> }
> 
> StaticArray!(A, n) lerp(A, uint n)...

That's what I figured as well. It's an ugly solution syntax-wise though,
but as the beautiful way is impossible, I suppose it is beautiful for
all practical purposes :-)

It just takes away some of the elegance of array/vector operations in
D as far as I'm concerned.

But I do have a modified struct-based vector implementation inspired
by work done by others here on the forum. That'll have to do until
then.

By the way: Is there a way to vote for features in D? :-)

And where might this get fixed? In D2 and D1 or only in D2?
I want to use D2 but my understanding is that DSSS or is that
Derelict, or both, only supports D1.

Best regards

Bent

> -Steve 
> 
> 



More information about the Digitalmars-d mailing list