Re: A different vector op

2011-07-18 Thread bearophile
Wilfried Kirschenmann:

 In fact, I would be more interested in the opposite :

If you allow that syntax on the left you probably allow it on the right too.

Bye,
bearophile


Re: A different vector op

2011-07-18 Thread Andrej Mitrovic
float[] buffers = malloc..;
float*[] CBuffers = buffers[].ptr;

Pure win.


Re: A different vector op

2011-07-06 Thread Don

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;
}


Re: A different vector op

2011-07-06 Thread bearophile
Don:

 An interesting use case:
 
 void main()
 {
 cdouble[100] foos;
 foos[].re = 5.0;
 }

I don't often have to update arrays of complex numbers, more often I have to 
set or update a single field of an array of structs.

Bye,
bearophile


A different vector op

2011-07-01 Thread bearophile
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