comparing two arrays ..

bearophile bearophileHUGS at lycos.com
Tue Nov 19 07:02:27 PST 2013


Adam D. Ruppe:

> a == b works on single dimension. Not sure about beyond that 
> though.

It works on nD arrays:

void main() {
     immutable m1 = [[1, 2], [3, 4]];
     immutable m2 = [[1, 2], [3, 4]];
     immutable m3 = [[1, 2], [3, 5]];
     assert(m1 == m2);
     assert(m1 != m3);
     assert(m1 < m3);
}

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list