Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 0.1.2
#1
Dear MISRA members,

I would have a question about MISRA C++:2023 Rule 0.1.2 which mentions in its rationale
"Overloaded operators are excluded from this rule because [...]"

Here, my question is whether in this scope, `operator()` should be considered to be a built-in operator.
Since to me, such one should instead be considered more of a normal function call.
Otherwise, it would undermine the rule's actual intention, which is to diagnose any unused return values of function calls, am I right?
Especially for modern C++ where plenty of code gets put into lambdas and/or std::function.

I would very happy if you could share some thoughts about this.

Thanks a lot in advance & best regards,
Stephan
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)