Download User's Guide

Transcript
StructKeyword.rule
Items Enforced
StructKeyword.rule
Do not use the ‘struct’ keyword to
declare a variable in C++
This rule checks whether your C++ code uses struct keywords to
declare a variable.
Reason for rule: Using the struct keyword to declare a variable
improves code readability.
Example
// struct keyword is unnecessary in C++ when declaring a
// variable.
struct Position_t {}
struct Position_t Pos1;
// Violation
Position_t Pos2;
// OK
325