Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
1290c7c0
Commit
1290c7c0
authored
Jun 08, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new rule regarding `explicit` to style guide
parent
a6774468
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
CONTRIBUTING.md
CONTRIBUTING.md
+10
-9
No files found.
CONTRIBUTING.md
View file @
1290c7c0
...
@@ -227,8 +227,8 @@ General rules
...
@@ -227,8 +227,8 @@ General rules
even for bodies consiting only of a single statement.
even for bodies consiting only of a single statement.
-
Opening braces belong to the same line:
-
Opening braces belong to the same line:
```
cpp
```
cpp
if
(
my_condition
)
{
if
(
my_condition
)
{
my_fun
();
my_fun
();
}
else
{
}
else
{
...
@@ -238,8 +238,8 @@ General rules
...
@@ -238,8 +238,8 @@ General rules
-
Use standard order for readability: C standard libraries, C++ standard
-
Use standard order for readability: C standard libraries, C++ standard
libraries, other libraries, (your) CAF headers:
libraries, other libraries, (your) CAF headers:
```
cpp
```
cpp
#include <sys/types.h>
#include <sys/types.h>
#include <vector>
#include <vector>
...
@@ -254,6 +254,7 @@ General rules
...
@@ -254,6 +254,7 @@ General rules
-
Never use C-style casts.
-
Never use C-style casts.
-
Protect single-argument constructors with
`explicit`
to avoid implicit conversions.
Naming
Naming
------
------
...
@@ -274,8 +275,8 @@ Naming
...
@@ -274,8 +275,8 @@ Naming
-
Template parameter names use CamelCase.
-
Template parameter names use CamelCase.
-
Getter and setter use the name of the member without the
`m_`
prefix:
-
Getter and setter use the name of the member without the
`m_`
prefix:
```
cpp
```
cpp
class
some_fun
{
class
some_fun
{
public:
public:
// ...
// ...
...
@@ -293,8 +294,8 @@ Naming
...
@@ -293,8 +294,8 @@ Naming
-
Use
`T`
for generic, unconstrained template parameters and
`x`
-
Use
`T`
for generic, unconstrained template parameters and
`x`
for generic function arguments. Suffix both with
`s`
for
for generic function arguments. Suffix both with
`s`
for
template parameter packs:
template parameter packs:
```
cpp
```
cpp
template
<
class
...
Ts
>
template
<
class
...
Ts
>
void
print
(
const
Ts
&
...
xs
)
{
void
print
(
const
Ts
&
...
xs
)
{
// ...
// ...
...
@@ -334,8 +335,8 @@ Breaking Statements
...
@@ -334,8 +335,8 @@ Breaking Statements
-
Break constructor initializers after the comma, use four spaces for
-
Break constructor initializers after the comma, use four spaces for
indentation, and place each initializer on its own line (unless you don't
indentation, and place each initializer on its own line (unless you don't
need to break at all):
need to break at all):
```
cpp
```
cpp
my_class
::
my_class
()
my_class
::
my_class
()
:
my_base_class
(
some_function
()),
:
my_base_class
(
some_function
()),
m_greeting
(
"Hello there! This is my_class!"
),
m_greeting
(
"Hello there! This is my_class!"
),
...
@@ -348,8 +349,8 @@ Breaking Statements
...
@@ -348,8 +349,8 @@ Breaking Statements
```
```
-
Break function arguments after the comma for both declaration and invocation:
-
Break function arguments after the comma for both declaration and invocation:
```
cpp
```
cpp
intptr_t
channel
::
compare
(
const
abstract_channel
*
lhs
,
intptr_t
channel
::
compare
(
const
abstract_channel
*
lhs
,
const
abstract_channel
*
rhs
)
{
const
abstract_channel
*
rhs
)
{
// ...
// ...
...
@@ -357,8 +358,8 @@ Breaking Statements
...
@@ -357,8 +358,8 @@ Breaking Statements
```
```
-
Break before tenary operators and before binary operators:
-
Break before tenary operators and before binary operators:
```
cpp
```
cpp
if
(
today_is_a_sunny_day
()
if
(
today_is_a_sunny_day
()
&&
it_is_not_too_hot_to_go_swimming
())
{
&&
it_is_not_too_hot_to_go_swimming
())
{
// ...
// ...
...
@@ -385,8 +386,8 @@ extra rules for formatting metaprogramming code.
...
@@ -385,8 +386,8 @@ extra rules for formatting metaprogramming code.
-
Use one level of indentation per "open" template and place the closing
`>`
,
-
Use one level of indentation per "open" template and place the closing
`>`
,
`>::type`
or
`>::value`
on its own line. For example:
`>::type`
or
`>::value`
on its own line. For example:
```
cpp
```
cpp
using
optional_result_type
=
using
optional_result_type
=
typename
std
::
conditional
<
typename
std
::
conditional
<
std
::
is_same
<
result_type
,
void
>::
value
,
std
::
is_same
<
result_type
,
void
>::
value
,
...
@@ -405,8 +406,8 @@ extra rules for formatting metaprogramming code.
...
@@ -405,8 +406,8 @@ extra rules for formatting metaprogramming code.
-
Note that this is not necessary when simply defining a type alias.
-
Note that this is not necessary when simply defining a type alias.
When dealing with "ordinary" templates, indenting based on the position of
When dealing with "ordinary" templates, indenting based on the position of
the opening
`<`
is ok, e.g.:
the opening
`<`
is ok, e.g.:
```
cpp
```
cpp
using
response_handle_type
=
response_handle
<
Subtype
,
message
,
using
response_handle_type
=
response_handle
<
Subtype
,
message
,
ResponseHandleTag
>
;
ResponseHandleTag
>
;
```
```
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment