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: https://github.com/nodejs/node/pull/20423
Reviewed-By: Anna Henningsen <anna@addaleax.net>
pull/20447/merge
Daniel Bevenius 2018-05-02 08:59:35 +02:00 committed by Anna Henningsen
parent 2c5b94f390
commit c8f8847120
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9
1 changed files with 10 additions and 0 deletions

View File

@ -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)
@ -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++