Skip to content

Commit

Permalink
forest insert also handles move_constructible only types.
Browse files Browse the repository at this point in the history
Insert now moves incoming object into node.
Insert now takes incoming object by value.
Chose take by value and move approach to limit code duplication and diff noise.
  • Loading branch information
CasparKielwein committed Sep 23, 2016
1 parent b932810 commit 5d4e1e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adobe/forest.hpp
Expand Up @@ -655,8 +655,8 @@ class forest {
iterator erase(const iterator& position);
iterator erase(const iterator& first, const iterator& last);

iterator insert(const iterator& position, const T& x) {
iterator result(new node_t(x), true);
iterator insert(const iterator& position, T x) {
iterator result(new node_t(std::move(x)), true);

if (size_valid())
++size_m;
Expand Down

0 comments on commit 5d4e1e2

Please sign in to comment.