C/C++ Code Style: update conventions for type & value naming #80
@ -99,7 +99,19 @@ int64_t size() const {...}
|
|||||||
|
|
||||||
### Enums
|
### Enums
|
||||||
|
|
||||||
- Labels in enums should be in all capitals.
|
- Enum type names should avoid being confused with related structs or classes.
|
||||||
|
|
||||||
|
Recommended suffixes include:
|
||||||
|
|
||||||
|
- `Type` & `Mode` for discrete values.
|
||||||
|
- `Flag` & `Mask` for values which are treated as bit-masks.
|
||||||
|
|
||||||
|
However these are guidelines which may be applied selectively.
|
||||||
|
Terms such as `Direction`, `Stage`, `Code` & `Method` (among others) are
|
||||||
|
sufficiently descriptive not to require one of the recommended suffixes.
|
||||||
|
|
||||||
|
- C style enum labels in enums should be in all capitals.
|
||||||
|
- C++ style enums labels which use `enum class` should use pascal-case.
|
||||||
- Enums used in DNA files should have explicit values assigned.
|
- Enums used in DNA files should have explicit values assigned.
|
||||||
|
|
||||||
### Function arguments
|
### Function arguments
|
||||||
|
Loading…
Reference in New Issue
Block a user