aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contributing.md26
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>