aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-09-19 13:26:43 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-09-19 13:26:47 -0400
commit920c090f63f4990bf0f3b3d1a6d3d8a8bcd14ba0 (patch)
treeadb2d00ea06ac90008d158124f816d7f54d5d35c /doc
parent2796c6e5ec9055545e987023b04eb5ebe64d5320 (diff)
parentb6718e373ed425fa2440ddd8f1b05c76b782dc2b (diff)
Merge #14287: tests: Use MakeUnique to construct objects owned by unique_ptrs
b6718e373e tests: Use MakeUnique to construct objects owned by unique_ptrs (practicalswift) Pull request description: A subset of #14211 ("Use MakeUnique to construct objects owned by unique_ptrs") as suggested by @MarcoFalke in https://github.com/bitcoin/bitcoin/pull/14211#issuecomment-423324019. Use `MakeUnique` to construct objects owned by `unique_ptr`s. Rationale: * `MakeUnique` ensures exception safety in complex expressions. * `MakeUnique` gives a more concise statement of the construction. Tree-SHA512: 1228ae6ce7beb178d79142c4e936b728178ccaa8aa35c6d8feeb33d1a667abfdd010c59996a9d833594611e913877ce5794e75953d11d9b1fdbac04aa491d9cf
Diffstat (limited to 'doc')
-rw-r--r--doc/developer-notes.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/developer-notes.md b/doc/developer-notes.md
index 7c9106a6c1..1d103d481b 100644
--- a/doc/developer-notes.md
+++ b/doc/developer-notes.md
@@ -439,6 +439,11 @@ General C++
- *Rationale*: This avoids memory and resource leaks, and ensures exception safety
+- Use `MakeUnique()` to construct objects owned by `unique_ptr`s
+
+ - *Rationale*: `MakeUnique` is concise and ensures exception safety in complex expressions.
+ `MakeUnique` is a temporary project local implementation of `std::make_unique` (C++14).
+
C++ data structures
--------------------