Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 972b94e

Browse filesBrowse 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 <anna@addaleax.net>
1 parent a438d25 commit 972b94e
Copy full SHA for 972b94e

File tree

Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Open diff view settings
Collapse file

‎CPP_STYLE_GUIDE.md‎

Copy file name to clipboardExpand all lines: CPP_STYLE_GUIDE.md
+10Lines changed: 10 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.