Small Vectors Proposal

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Thu Feb 1 09:53:03 PST 2007


Andrei Alexandrescu (See Website For Email) wrote:
> Oskar Linde wrote:
>> If static arrays became a value type, all irregularities could disappear.
> 
> But then people will complain about the inconsistency between static 
> arrays and dynamic arrays. Why some are passed by value and others are 
> passed by reference?

I don't see much complaints about the "inconsistency" between structs 
and classes (which is probably the closest thing in the language currently).
Besides, static arrays are already more of a value type (typically 
allocated on the stack, directly in an aggregate, or in static data, 
like structs) and dynamic arrays more of a reference type (typically 
allocated on the heap, like classes).
The biggest difference is that dynamic arrays _can_ also refer to static 
arrays.



More information about the Digitalmars-d mailing list