Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
6-5-2 and 6-5-4 on while loop checking std::vector::empty()
#4
In this case, you are right, there is no loop counter, so the rules don't apply.

The definitions in the introductory section are expressed in terms of the 'for loop' syntax, and show the equivalence of a 'for loop' and 'while loop'. This shows the while loop as 'while (condition)'. The definition of loop-counter requires it to be a loop-control-variable that is "an operand to a relational operator in condition". As there are no relational operators in the condition in the example code, there is no loop-counter
Posted by and on behalf of
the MISRA C++ Working Group
Reply


Messages In This Thread
RE: 6-5-2 and 6-5-4 on while loop checking std::vector::empty() - by misra cpp - 18-11-2021, 10:33 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)