Dynamic memory
CraigDillabaugh via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Jul 28 13:17:17 PDT 2015
On Tuesday, 28 July 2015 at 20:07:12 UTC, Steven Schveighoffer
wrote:
> On 7/28/15 3:33 PM, CraigDillabaugh wrote:
>
>> 6. (IMHO) Code is actually more readable. But then I find
>> lots of
>> brackets confusing ... so maybe its just me.
>
> Have you considered a wrapper that uses multi-dimensional
> access? i.e.:
>
> my2darray[row, col] = blah;
>
> -Steve
It has crossed my mind, but I've got so used to doing the
position calculations I haven't yet tried it. I guess you would
simply need to put your array in a struct and overload the '[]'
operator correct? (Plus the appropriate constructors, etc).
More information about the Digitalmars-d-learn
mailing list