Example:
BitArray a = [1, 0, 1];
const BitArray b = [0, 1, 1];
a ~= b; // compile error
a |= b; // But its works
Arg b hasnt const in method opOpAssign(string op)(BitArray b) if (op == "~").
All methods and properties that called from body is const.
Please, check also opBinary and opCmp that const method but param isnt const:
const BitArray a = [1, 0];
const BitArray bc = [0, 1];
BitArray c = a ~ bc; // compile error
BitArray bm = [0, 1];
BitArray cc = a ~ bm; // compiles
Example:
Arg
bhasnt const in methodopOpAssign(string op)(BitArray b) if (op == "~").All methods and properties that called from body is const.
Please, check also
opBinaryandopCmpthat const method but param isnt const: