From 31bf994669ed93104405b1fa5fb9fcca93b44d91 Mon Sep 17 00:00:00 2001 From: liuzicheng1987 Date: Sun, 5 Nov 2023 13:13:42 +0100 Subject: [PATCH] Added a qualification about std::move and rfl::Box --- docs/rfl_ref.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rfl_ref.md b/docs/rfl_ref.md index 53c0eb26..56588377 100644 --- a/docs/rfl_ref.md +++ b/docs/rfl_ref.md @@ -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/)