Skip to content

Commit

Permalink
fix swap and serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
fmontoto committed Sep 15, 2016
1 parent d2c0617 commit 596ed37
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/sdsl/k2_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ class k2_tree
k_l = tr.k_l;
k_t_rank = tr.k_t_rank;
k_t_rank.set_vector(&k_t);
k_k = tr.k_k;
k_height = tr.k_height;
}
return *this;
}
Expand All @@ -339,7 +341,10 @@ class k2_tree
{
if (this != &tr) {
std::swap(k_t, tr.k_t);
std::swap(k_l, tr.k_l);
util::swap_support(k_t_rank, tr.k_t_rank, &k_t, &(tr.k_t));
std::swap(k_k, tr.k_k);
std::swap(k_height, tr.k_height);
}
}

Expand Down Expand Up @@ -457,7 +462,7 @@ class k2_tree
* \returns The number of written bytes.
*/
size_type serialize(std::ostream& out, structure_tree_node* v=nullptr,
std::string name="")
std::string name="") const
{
structure_tree_node* child = structure_tree::add_child(
v, name, util::class_name(*this));
Expand Down

0 comments on commit 596ed37

Please sign in to comment.