Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorLev Dragunov <l.dragunov@corp.mail.ru>2015-12-16 13:09:39 +0300
committerLev Dragunov <l.dragunov@corp.mail.ru>2015-12-18 13:03:34 +0300
commitdc5b80882e71347955720dbe4528f6a5ba67da19 (patch)
tree877170001e83bb9a58f6bf76296540e6c71110cc /docs
parente14ec3f96bfd17ef2a4b27d5ab86810bbc485f20 (diff)
Styleguide tacit agreements.
Diffstat (limited to 'docs')
-rw-r--r--docs/CPP_STYLE.md7
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/CPP_STYLE.md b/docs/CPP_STYLE.md
index e9fa1646e9..d69a07523e 100644
--- a/docs/CPP_STYLE.md
+++ b/docs/CPP_STYLE.md
@@ -25,7 +25,8 @@ Naming and formatting
- Space after the keyword in conditions and loops. Space after `;` in `for` loop.
- Space between binary operators: `x = y * y + z * z`.
- Space after double dash.
-- Compile-time constants must be named in camelCase, starting with a lower-case `k`, e.g. `kCompileTimeConstant`.
+- We use `using` keyword instead of `typedef`.
+- Compile-time constants must be named in camelCase, starting with a lower-case `k`, e.g. `kCompileTimeConstant` and marked as `constexpr` when possible.
- Values of enum classes must be named in CamelCase, e.g. `enum class Color { Red, Green, LightBlue };`.
- Macros and C-style enums must be named in UPPER_CASE, and enum values must be prefixed with a capitalized enum name.
@@ -48,7 +49,7 @@ To automatically format a file, install `clang-format` and run:
#include "std/math.hpp"
-uint16_t const kBufferSize = 255;
+uint16_t constexpr kBufferSize = 255;
// C-style enums are ALL_CAPS. But remember that C++11 enum classes are preferred.
enum Type
@@ -58,7 +59,7 @@ enum Type
TYPE_STRING
};
-typedef double TMyTypeStartsWithCapitalTLetter;
+using TMyTypeStartsWithCapitalTLetter = double;
class ComplexClass
{