Array Lower Bounds

Bill Baxter dnewsgroup at billbaxter.com
Mon Dec 17 21:38:32 PST 2007


Mike Marquard wrote:
> I know the default starting index for arrays is zero in D. But is there any way you can change the lower bounds to something other zero? For instance having the index go from 1 to 10 or say 100 to 200.
> 
> If not are there any plans to add this feature in the future?

That's a Fortran feature, right?
D doesn't have it and I pretty much doubt it ever will.

You could try to create your own user type with this feature.  But lack 
of ability to return lvalues in D makes it impossible to create an array 
type that works just like the built-in arrays.

--bb


More information about the Digitalmars-d-learn mailing list