Array operation with boolean operator

Andrea Fontana nospam at example.com
Thu Mar 14 11:12:19 PDT 2013


On Thursday, 14 March 2013 at 17:56:07 UTC, Ali Çehreli wrote:
> On 03/14/2013 10:45 AM, Andrea Fontana wrote:
>
> > You see? Your code do this:
> >
> > a[] = (b[] < c[]);
>
> I thought the same thing at first but note the brackets after b 
> and c. Those should make this an array-wise operation.
>
> For all elements of a to be the same value, one would not write 
> the brackets:
>
>     a[] = b < c;
>
> Some of the array-wise operations are confusing. :/
>
> Ali

Doesn't a[] means copy of a?
So copyofa[] < copyofb[] == bool

I don't think a boolean operator can be array-wise... I always 
think X < Y return a single bool, indipendently from X or Y type 
(class, array or what else). Math operations is a different topic 
in my mind.


More information about the Digitalmars-d-learn mailing list