Skip to content

Commit

Permalink
Implement move semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonCampolattaro committed Jul 2, 2020
1 parent 2c28636 commit 01504a5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Octree/include/CGAL/Octree/Node.h
Expand Up @@ -25,14 +25,19 @@ namespace CGAL {

public:

Node(Value value, Node<Value> *parent = nullptr) {
Node(Value value, Node<Value> *parent = nullptr) : m_value(value), m_parent(parent) {

m_value = value;
m_parent = parent;
if (parent)
m_depth = parent->m_depth + 1;
}

Node(Node&& other) {

m_value = other.m_value;
m_parent = other.m_parent;
m_children = std::move(other.m_children);
}

// The default constructor is enough

void split() {
Expand Down

0 comments on commit 01504a5

Please sign in to comment.