diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-05 18:48:46 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-05 18:48:46 +0100 |
commit | 3fe7400de095756362b999908fd2a2ba3b71a848 (patch) | |
tree | 8a6c6d4213fdab076a451f37e6471ca5965b2c8f /contributing.md | |
parent | ae6a103946e437ca85cc69c5fc2cbf68d35ffeae (diff) |
merge #18
Diffstat (limited to 'contributing.md')
-rw-r--r-- | contributing.md | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/contributing.md b/contributing.md index 2fe46f7..e910dba 100644 --- a/contributing.md +++ b/contributing.md @@ -386,6 +386,37 @@ that you can click on to open them. #endif ``` </td></tr></table></details> +- <details><summary> + Variables that are being moved always use the fully qualified <code>std::move</code> + </summary><table><tr><th>Good</th><th>Bad</th></tr><tr><td> + + ```cpp + using namespace std; + string foo = "bar"; + ref_fn(std::move(foo)); + ``` + </td><td> + + ```cpp + using namespace std; + string foo = "bar"; + ref_fn(move(foo)); + ``` + </td></tr></table></details> +- <details><summary> + If possible, classes and structs are passed to functions by (const) reference + </summary><table><tr><th>Good</th><th>Bad</th></tr><tr><td> + + ```cpp + void foo(const Point & p); + ``` + </td><td> + + ```cpp + void foo(Point & p); + void bar(Point p); + ``` + </td></tr></table></details> ## CMakeLists-specific |