forked from organicmaps/organicmaps
Styleguide tacit agreements.
This commit is contained in:
parent
e14ec3f96b
commit
dc5b80882e
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue