Added a qualification about std::move and rfl::Box

This commit is contained in:
liuzicheng1987
2023-11-05 13:13:42 +01:00
committed by GitHub
parent 0b94bf5aeb
commit 31bf994669
+1 -1
View File
@@ -107,7 +107,7 @@ struct DecisionTree {
};
```
`rfl::Box` is a thin wrapper around `std::unique_ptr`, but it is guaranteed to **never be null**. It is a `std::unique_ptr` without the `nullptr`.
`rfl::Box` is a thin wrapper around `std::unique_ptr`, but it is guaranteed to **never be null** (unless you do something egregious such as trying to access it after calling `std::move`). It is a `std::unique_ptr` without the `nullptr`.
If you want to learn more about the evils of null references, check out the
[Null References: The Billion Dollar Mistake](https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare/)