diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-19 20:24:49 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-19 20:24:49 +0100 |
commit | 9c11853f7331fd740c763f5cc8f34903526a85d4 (patch) | |
tree | a6d75b961b3dcf8b7b3d9b5e8e65e9cb53790169 /contributing.md | |
parent | 1a2e4005e2e164b81f229210836df794cc0ba9fa (diff) |
update contributing.md
Diffstat (limited to 'contributing.md')
-rw-r--r-- | contributing.md | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/contributing.md b/contributing.md index d617a66..d217410 100644 --- a/contributing.md +++ b/contributing.md @@ -177,40 +177,28 @@ that you can click on to open them. ``` </td></tr></table></details> - <details><summary> - <code>using namespace</code> may not be used in header files (.h, .hpp), only - in source files (.cpp). + <a href="https://en.cppreference.com/w/cpp/language/using_declaration">Using-declarations</a> + may not be used in header files (<code>.h</code>, <code>.hpp</code>), only in + source files (<code>.cpp</code>). </summary><table><tr><th>Good</th><th>Bad</th></tr><tr><td> example.h: ```cpp namespace crepe { - void foo(); + std::string foo(); } ``` - example.cpp: - ```cpp - #include "example.h" - using namespace crepe; - void foo() {} - ``` </td><td> example.h: ```cpp + using namespace std; + namespace crepe { - template <typename T> - T foo(); + string foo(); } ``` - - example.hpp: - ```cpp - #include "example.h" - using namespace crepe; - template <typename T> - T foo(); - ``` </td></tr></table></details> - <details><summary> |