Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
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.

Refs: #20423
  • Loading branch information
danbev committed May 2, 2018
commit 230cf8a79c13ac2f6dd661ff409697453dfdfdda
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