From 2ee8a6d26952a7d0bfcb75eb2a855af9be6c23c4 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 16 Apr 2015 15:47:08 +0200 Subject: [PATCH] Coding standards to address auto usage. --- CodingStandards.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CodingStandards.txt b/CodingStandards.txt index bd5cb4ce7..66a61f6ae 100644 --- a/CodingStandards.txt +++ b/CodingStandards.txt @@ -116,6 +116,7 @@ g. Never use a macro where adequate non-preprocessor C++ can be written. h. Make use of auto whenever type is clear or unimportant: - Always avoid doubly-stating the type. - Use to avoid vast and unimportant type declarations. +- However, avoid using auto where type is not immediately obvious from the context, and especially not for arithmetic expressions. i. Don't pass bools: prefer enumerations instead. j. Prefer enum class to straight enum.