Commit c0e4af51 authored by Dominik Charousset's avatar Dominik Charousset

Add breaking rules to style guide

parent af851928
This document specifies the coding style for the C++ Actor Framework. This document specifies the coding style for the C++ Actor Framework.
The style is based on the The style is loosely based on the
[Google C++ Style Guide](http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml). [Google C++ Style Guide](http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml)
and the coding conventions used by the STL.
Example for the Impatient Example for the Impatient
========================= =========================
...@@ -246,6 +247,44 @@ Headers ...@@ -246,6 +247,44 @@ Headers
- Use `inline` for small functions (rule of thumb: 10 lines or less). - Use `inline` for small functions (rule of thumb: 10 lines or less).
Breaking Statements
===================
- Break constructor initializers after the comma, use four spaces for
indentation, and place each initializer on its own line (unless you don't
need to break at all):
```cpp
my_class::my_class()
: my_base_class(some_function()),
m_greeting("Hello there! This is my_class!"),
m_some_bool_flag(false) {
// ok
}
other_class::other_class() : m_name("tommy"), m_buddy("michael") {
// ok
}
```
- Break function arguments after the comma for both declaration and invocation:
```cpp
intptr_t channel::compare(const abstract_channel* lhs,
const abstract_channel* rhs) {
// ...
}
```
- Break before tenary operators and before binary operators:
```cpp
if (today_is_a_sunny_day()
&& it_is_not_too_hot_to_go_swimming()) {
// ...
}
```
Template Metaprogramming Template Metaprogramming
======================== ========================
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment