Arrays
Frits van Bommel
fvbommel at REMwOVExCAPSs.nl
Fri Mar 16 10:51:26 PDT 2007
Patrick wrote:
> I have a list of vectors and I want to be able to add a vector through a function like this:
>
> float[3] giveVector();
> -----
> float[][3] vectorList;
> vectorList ~= giveVector();
> -----
>
> Any ideas on how to implement this? It doesnt really feel right to wrap the vector up in a class or struct...
Why would wrapping it in a simple struct not "feel right"? That's how
vectors are typically implemented in D, judging by posts in these
newsgroups.
(Hint: you may want to search these groups to see how others have
implemented vectors & matrices to avoid reinventing the wheel for the
Nth time)
More information about the Digitalmars-d-learn
mailing list