Skip to content

Commit 972b94e

Browse files
danbevMylesBorins
authored andcommitted
doc: add snake_case section for C-like structs
This commit adds a section mentioning that for C-like structs it is alright to use snake_case. PR-URL: #20423 Reviewed-By: Anna Henningsen <[email protected]>
1 parent a438d25 commit 972b94e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

CPP_STYLE_GUIDE.md

+10
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* [CamelCase for methods, functions, and classes](#camelcase-for-methods-functions-and-classes)
1313
* [snake\_case for local variables and parameters](#snake_case-for-local-variables-and-parameters)
1414
* [snake\_case\_ for private class fields](#snake_case_-for-private-class-fields)
15+
* [snake\_case\_ for C-like structs](#snake_case_-for-c-like-structs)
1516
* [Space after `template`](#space-after-template)
1617
* [Memory Management](#memory-management)
1718
* [Memory allocation](#memory-allocation)
@@ -147,6 +148,15 @@ class Foo {
147148
};
148149
```
149150

151+
## snake\_case\_ for C-like structs
152+
For plain C-like structs snake_case can be used.
153+
154+
```c++
155+
struct foo_bar {
156+
int name;
157+
}
158+
```
159+
150160
## Space after `template`
151161
152162
```c++

0 commit comments

Comments
 (0)