From 018b5ad800cc28a298d68dab33649adc1e8656e8 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 2 May 2018 08:59:35 +0200 Subject: [PATCH] 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 --- CPP_STYLE_GUIDE.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CPP_STYLE_GUIDE.md b/CPP_STYLE_GUIDE.md index edc5f0f12e212c..41e1f082f87751 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++