>>Overloaded operators are functions, so there is no problem.
Sure.
The point is readability and it can cause confusion for maintainers.
>>Overloaded operators are functions, so there is no problem.
Sure.
The point is readability and it can cause confusion for maintainers.
Last edited by King Mir; 06-28-2011 at 07:38 AM.
It is too clear and so it is hard to see.
A dunce once searched for fire with a lighted lantern.
Had he known what fire was,
He could have cooked his rice much sooner.
Apart from missing closing bracket (which will typically trigger a compiler diagnostic) and misspelling of length, yeah.
However, it is also quite reasonable to - as some coding guidelines do - stipulate that loop condition not have side effects, and code your particular loop as
One (often intended) effect of such coding guidelines is that it reduces chances of using macros unsafely.Code:while(!cmp(array1[run_length],value)) ++run_length;
Of course, the notion of "reasonableness" in code is subjective.