Originally Posted by
laserlight
I saw this over the weekend but got a bit distracted and forgot to reply. I was going to say that seems fine to me, although 3 seems to be the same as 1 with the boolean set to false, but maybe you meant "set a scalar matrix" rather than creating a new one.
Ah, the implication being that the old behaviour is B, so even though a scalar matrix isn't a scalar, by association it sounds close enough to be "more consistent, mathematically"? I think that works too, except that then you'll have to forbid assignment of a scalar to a non-square matrix, and if you do have a constructor that takes a scalar, it would be consistent for that scalar to populate a square matrix by default, which could make it a little odd to handle for non-square matrices (e.g., do you make it a must for a non-square matrix have the boolean set, or do you default to fill instead if the matrix is non-square, even though this could lead to surprises).