...
| Code Block | ||||
|---|---|---|---|---|
| ||||
EncodedPacket(uint8_t *dataRef); //NOT EncodedPacket(uint8_t dataRef); |
Constexpr, not Macros
Use constant expressions (constexpr) for small helper functions.
| Code Block | ||
|---|---|---|
| ||
constexpr int square(int x) { return x*x; }
//NOT
#define SQUARE(r) ((r)*(r))
double square_macro = AREA(4.6); |