A different vector op

Don nospam at nospam.com
Tue Jul 5 23:59:19 PDT 2011


bearophile wrote:
> Currently this is not allowed, but do you desire a feature like this?
> 
> 
> struct Foo {
>     int x, y;
>     int[100] array;
> }
> void main() {
>     auto foos = new Foo[100];
>     foos[].y += 10; // ***
> }
> 
> Bye,
> bearophile

An interesting use case:

void main()
{
    cdouble[100] foos;
    foos[].re = 5.0;
}


More information about the Digitalmars-d-learn mailing list