Skip to content

Commit

Permalink
doc: add snake_case section for C-like structs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
danbev authored and MylesBorins committed May 9, 2018
1 parent 6acefc3 commit 018b5ad
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CPP_STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* [CamelCase for methods, functions, and classes](#camelcase-for-methods-functions-and-classes)
* [snake\_case for local variables and parameters](#snake_case-for-local-variables-and-parameters)
* [snake\_case\_ for private class fields](#snake_case_-for-private-class-fields)
* [snake\_case\_ for C-like structs](#snake_case_-for-c-like-structs)
* [Space after `template`](#space-after-template)
* [Memory Management](#memory-management)
* [Memory allocation](#memory-allocation)
Expand Down Expand Up @@ -147,6 +148,15 @@ class Foo {
};
```

## snake\_case\_ for C-like structs
For plain C-like structs snake_case can be used.

```c++
struct foo_bar {
int name;
}
```
## Space after `template`
```c++
Expand Down

0 comments on commit 018b5ad

Please sign in to comment.