From f56bd4ce9de35edc0c9fb178c950f26c80d99b94 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Fri, 22 Oct 2021 12:42:06 +0300 Subject: Update coding style --- doc/contribute.md | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'doc') diff --git a/doc/contribute.md b/doc/contribute.md index 21746433..595a5996 100644 --- a/doc/contribute.md +++ b/doc/contribute.md @@ -94,3 +94,10 @@ If there are no preconfigured rules for your IDE, you can use one of the existin - **Includes** : - files from the project : `#include "relative/path/to/the/file.h"` - external files and std : `#include ` + - Only use [primary spellings for operators and tokens](https://en.cppreference.com/w/cpp/language/operator_alternative) + - Use auto sparingly. Don't use auto for [fundamental/built-in types](https://en.cppreference.com/w/cpp/language/types) and [fixed width integer types](https://en.cppreference.com/w/cpp/types/integer), except when initializing with a cast to avoid duplicating the type name. + - Examples: + - `auto* app = static_cast(instance);` + - `auto number = static_cast(variable);` + - `uint8_t returnValue = MyFunction();` + - Use nullptr instead of NULL -- cgit v1.2.3