diff options
| -rw-r--r-- | doc/CODING_STYLE.md | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/CODING_STYLE.md b/doc/CODING_STYLE.md index 57d4478..ba3fcb5 100644 --- a/doc/CODING_STYLE.md +++ b/doc/CODING_STYLE.md @@ -108,6 +108,25 @@ Use designated initializers, not field-by-field assignment. --- +## Control Flow Braces + +**Rule:** Multi-line `for` or `if` statements must use curly braces. + +### Good +```cpp +for (int i = 0; i < 10; ++i) { + do_something(i); +} +``` + +### Bad +```cpp +for (int i = 0; i < 10; ++i) + do_something(i); +``` + +--- + ## Class Keywords Indentation ```cpp |
