...
Code Block | ||||
---|---|---|---|---|
| ||||
enum EnumType { First, Second, Third }; void f(int intVar) { if (intVar < First || intVar > Third) { // Handle error } EnumType enumVar = static_cast<EnumType>(intVar); } |
Automated Detection
Tool | Version | Checker | Description |
---|---|---|---|
PRQA QA-C++ | 4.1 | 2910, 2911, 2912, 2913 |
Compliant Solution (Scoped Enumeration)
...