diff options
author | Jacques Lucke <jacques@blender.org> | 2020-06-29 13:35:09 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-06-29 13:35:27 +0300 |
commit | 38c9deeb5ac0a9407659d5ded7d31430de408dd7 (patch) | |
tree | 2ae5ab155c6e83be6a6c7efd25690582f1a937ed /source | |
parent | 2def6f5568ee76a56a139799116c67cdcfc19814 (diff) |
Cleanup: use std::make_unique instead of blender::make_unique
This is possible, because we use C++17 now.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/derived_node_tree.cc | 4 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_memory_utils.hh | 8 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_rna.cc | 2 |
3 files changed, 3 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/derived_node_tree.cc b/source/blender/blenkernel/intern/derived_node_tree.cc index 065179fc9a7..d6e1a127048 100644 --- a/source/blender/blenkernel/intern/derived_node_tree.cc +++ b/source/blender/blenkernel/intern/derived_node_tree.cc @@ -25,8 +25,8 @@ namespace bke { static const NodeTreeRef &get_tree_ref(NodeTreeRefMap &node_tree_refs, bNodeTree *btree) { - return *node_tree_refs.lookup_or_add_cb( - btree, [&]() { return blender::make_unique<NodeTreeRef>(btree); }); + return *node_tree_refs.lookup_or_add_cb(btree, + [&]() { return std::make_unique<NodeTreeRef>(btree); }); } DerivedNodeTree::DerivedNodeTree(bNodeTree *btree, NodeTreeRefMap &node_tree_refs) : m_btree(btree) diff --git a/source/blender/blenlib/BLI_memory_utils.hh b/source/blender/blenlib/BLI_memory_utils.hh index 81792e2101c..baad862bce5 100644 --- a/source/blender/blenlib/BLI_memory_utils.hh +++ b/source/blender/blenlib/BLI_memory_utils.hh @@ -204,14 +204,6 @@ template<typename T> void uninitialized_fill_n(T *dst, uint n, const T &value) } } -/** - * The same as std::unique_ptr. This can be removed when we start using C++14. - */ -template<typename T, typename... Args> std::unique_ptr<T> make_unique(Args &&... args) -{ - return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); -} - template<typename T> struct DestructValueAtAddress { void operator()(T *ptr) { diff --git a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc index fbd53bf46f8..5d075ff19b2 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc @@ -365,7 +365,7 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, RNANodeQueryIDData *RNANodeQuery::ensure_id_data(const ID *id) { unique_ptr<RNANodeQueryIDData> &id_data = id_data_map_.lookup_or_add_cb( - id, [&]() { return blender::make_unique<RNANodeQueryIDData>(id); }); + id, [&]() { return std::make_unique<RNANodeQueryIDData>(id); }); return id_data.get(); } |