runtime static arrays

Jonathan M Davis jmdavisProg at gmx.com
Tue Nov 20 17:50:07 PST 2012


On Wednesday, November 21, 2012 02:26:35 bearophile wrote:
> Namespace:
> > Is there an official statement why Walter dislike them?
> 
> In the last years I remember no comments from him about this
> topic. But he has not closed my enhancement request.

One serious problem posed by them is that the size then can't be part of the 
type, meaning that you can't possibly pass them around. If you did, you'd just 
be passing dynamic arrays around. You'd have the same problem with them with 
templates - everything instantiated with them would have to be instantiated as 
a dynamic array, which could cause problems.

So, while in principle, I like the idea of being able to have the size of a 
static array determined when it's created, there are definitely problems with 
doing that once you start getting into the details of what that would mean.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list