summaryrefslogtreecommitdiff
path: root/src/Simplex_tree/include/gudhi/Simplex_tree.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Simplex_tree/include/gudhi/Simplex_tree.h')
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h
index d604f994..4759b352 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h
@@ -360,6 +360,21 @@ class Simplex_tree {
return *this;
}
+ /** \brief User-defined move assignment reproduces the whole tree structure. */
+ Simplex_tree& operator=(Simplex_tree&& simplex_source)
+ {
+#ifdef DEBUG_TRACES
+ std::cout << "move assignment" << std::endl;
+#endif // DEBUG_TRACES
+ // Self-assignment detection
+ if (&simplex_source != this) {
+ std::swap( null_vertex_, simplex_source.null_vertex_ );
+ std::swap( root_, simplex_source.root_ );
+ std::swap( filtration_vect_, simplex_source.filtration_vect_ );
+ std::swap( dimension_, simplex_source.dimension_ );
+ }
+ return *this;
+ }
/** @} */ // end constructor/destructor
private:
// Recursive deletion