newsched
newsched copied to clipboard
Changes to coding standard for 4.0
Please add comments in this thread that should be changed as part of the coding standard.
Enums
Enums should use enum class
The names of enumerations should be lower case, and not require GR_
or _TYPE
because of the scoping of the enum class
Enum identifiers should be suffixed with `_type'
Specify data type for the enum only if necessary
Starting values should not be necessary
example:
enum class waveform_type {
sin,
cos,
triangle,
sawtooth
};
if/else brackets
modify the .clang-format file so that should look like
if {
// code
}
else {
// more code
}
(in GR3 it is)
if {
// code
} else {
// more code
}
using x =
instead of typedef
initialize variables in preference order:
- class definition
- constructor initialization list
- constructor body Prefer brace initialization