Изменил(а) на 'C/C++ Coding Conventions'

2023-06-16 18:00:36 +03:00
parent 27e6af3813
commit a89471c69e

@@ -1,6 +1,9 @@
### Вот некоторые соглашения которые сейчас используются и должны использоваться дальше в нашем коде: ### Вот некоторые соглашения которые сейчас используются и должны использоваться дальше в нашем коде:
**1. We use include guards instead of #pragma once** **1. We use include guards instead of #pragma once**
**2. 3rd-party headers must be included using <>, and our files - using ""** **2. 3rd-party headers must be included using <>, and our files - using ""**
**3. Author information, like "Created by John Doe on xx.xx.xxxx", which is inserted automatically by many IDEs when creating a new file, is not allowed and must be removed** **3. Author information, like "Created by John Doe on xx.xx.xxxx", which is inserted automatically by many IDEs when creating a new file, is not allowed and must be removed**
**4. General naming conventions examples:** **4. General naming conventions examples:**
@@ -24,7 +27,9 @@
| Boolean getters | canFoo, hasFoo, isFoo, ... | | Boolean getters | canFoo, hasFoo, isFoo, ... |
**5. For asynchronous functions use suffix "Async"**, e.g: `void loadAsync()` **5. For asynchronous functions use suffix "Async"**, e.g: `void loadAsync()`
**6. Avoid using `[&]` or `[=]` as lambda captions. It often causes problems with dangling references.** **6. Avoid using `[&]` or `[=]` as lambda captions. It often causes problems with dangling references.**
**7. Put bodies of selection and iteration statements into compound blocks, even if the body is a one-liner** E.g.: **7. Put bodies of selection and iteration statements into compound blocks, even if the body is a one-liner** E.g.:
``` ```
// Bad // Bad