| High Integrity CPP Guideline 8.4.6 | Use class types or typedefs to indicate scalar quantities. |
| Justification |
Using class types to represent scalar quantities exploits compiler enforcement of type safety. If this is not possible typedefs should be used to aid readability of code for manual checking. #include "class_time_stamp.h"; ClassTimeStamp start_time; // prefer (compiler type checking) long start_time; // avoid typedef long TimeStamp; TimeStamp start_time; // prefer |
| Reference |
Industrial Strength C++ 15.12; |