mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-16 10:24:43 +02:00
Update CONTRIBUTING.md
Define the braces position in C++ header files.
This commit is contained in:
parent
2df765e189
commit
47481c76e8
@ -67,7 +67,20 @@ In short: The easier the code review is, the better the chance your pull request
|
||||
// Do something
|
||||
}
|
||||
```
|
||||
|
||||
However, the method definition could be defined in a header file (.h), if there's one line code only. In this case, Java-like braces should be used.
|
||||
* ###### Good:
|
||||
```cpp
|
||||
class MyClass
|
||||
{
|
||||
public:
|
||||
void method1();
|
||||
int method2() {
|
||||
return _x; // only one line code can be placed in .h as method definition
|
||||
}
|
||||
private:
|
||||
int _x;
|
||||
}
|
||||
```
|
||||
2. ##### Use tabs instead of white-spaces (we usually set our editors to 4 white-spaces for 1 tab, but the choice is up to you).
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user