... | ... | @@ -18,7 +18,7 @@ The use of dynamic allocation can lead to heap fragmentation and out-of-memory e |
|
|
Recursive code is hard to read and debug, and can easy lead to stack overflow errors.
|
|
|
- **Every class with a virtual function shall define a virtual destructor**
|
|
|
Avoid undefined behavior where a derived class is destroyed through a reference to the base class, possibly leaking resources.
|
|
|
- **Every header file shall be guarded using defines containing the full project path of the file, or pragma once**
|
|
|
- **Every header file shall be guarded using defines containing the full project path of the file, or by using #pragma once**
|
|
|
Avoid conflicts when having files with the same name in multiple directories.
|
|
|
Example: File `src/shared/sensors/ExampleSensor.h`
|
|
|
```cpp
|
... | ... | |