... | ... | @@ -11,13 +11,14 @@ We follow the [Google C++ style guide](https://google.github.io/styleguide/cppgu |
|
|
| Functions | `camelCase()` | |
|
|
|
| Header guards | `FILE_NAME_HPP_` | If the file is named `FileName.hpp`. |
|
|
|
| `endif` comment for header guard | `endif // FILE_NAME_HPP_` | The `endif` comment at the end of the header file should match the `ifndef` at the beginning of the header file. |
|
|
|
| class file name | `ClassName.hpp` and `ClassName.cpp` | Previously we used the format `class_name.hpp` and `class_name.cpp`. |
|
|
|
| class file name | `class_name.hpp` and `class_name.cpp` | Previously we used the format `ClassName.hpp` and `ClassName.cpp`. |
|
|
|
| file without a class | `file_name.hpp` and `file_name.cpp` | |
|
|
|
| Constants | `UPPERCASE_AND_UNDERSCORE` | |
|
|
|
| Comment on the closing bracket of a class | `// ClassName` | For an example, see [this example](#example-class). |
|
|
|
|
|
|
### Additional general naming rules:
|
|
|
- While naming, avoid using numbers in variables when appropriate.
|
|
|
- For interfaces (which can be defined as classes that only have pure virtual functions), use the naming convention `ClassNameInterface`.
|
|
|
|
|
|
## Spacing
|
|
|
|
... | ... | |