summaryrefslogtreecommitdiff
path: root/CPP_STYLE_GUIDE.md
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2018-05-02 08:59:35 +0200
committerAnna Henningsen <anna@addaleax.net>2018-05-06 21:38:00 +0200
commitc8f88471204cb30b5a1b5ac72173be547654023a (patch)
tree4cc8eb3c0b5e0172f571a0f61db355cc8f451b17 /CPP_STYLE_GUIDE.md
parent2c5b94f390ff4c6e4a90af9f36b808e70b44709f (diff)
downloadandroid-node-v8-c8f88471204cb30b5a1b5ac72173be547654023a.tar.gz
android-node-v8-c8f88471204cb30b5a1b5ac72173be547654023a.tar.bz2
android-node-v8-c8f88471204cb30b5a1b5ac72173be547654023a.zip
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>
Diffstat (limited to 'CPP_STYLE_GUIDE.md')
-rw-r--r--CPP_STYLE_GUIDE.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/CPP_STYLE_GUIDE.md b/CPP_STYLE_GUIDE.md
index edc5f0f12e..41e1f082f8 100644
--- a/CPP_STYLE_GUIDE.md
+++ b/CPP_STYLE_GUIDE.md
@@ -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++