Skip to content

Commit d3a1c8a

Browse files
committed
ADD: it's 2024, only-smart-pointer-policy added
1 parent e0ca337 commit d3a1c8a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ private:
115115
#include "aiacpch.h"
116116
```
117117

118+
### Only smart (or unique) pointers
119+
It's 2024, we can pass on raw pointers. We use smart pointers.
120+
```c++
121+
std::unique_ptr<AnExampleClass> example = std::make_unique<AnExampleClass>(0);
122+
```
123+
Or if you really need to use an unique pointer because you don't want to transfer the ownership of the object, use a shared pointer.
124+
```c++
125+
std::shared_ptr<AnExampleClass> example = std::make_shared<AnExampleClass>(0);
126+
```
127+
118128
### Debugging with GDB
119129
We use GDB for debugging. To install GDB on windows, do the following:
120130
1. Download the MSYS2 installer from the [MSYS2 website](https://www.msys2.org/).

0 commit comments

Comments
 (0)