Skip to content

Commit

Permalink
Enable resize for move-only types
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser authored and martinus committed Jun 3, 2022
1 parent 6ee4865 commit d75f112
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/lib/ankerl/svector.h
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,14 @@ class svector {
}

void resize(size_t count) {
resize(count, T());
if (count > capacity()) {
reserve(count);
}
if (is_direct()) {
resize_after_reserve<direction::direct>(count);
} else {
resize_after_reserve<direction::indirect>(count);
}
}

void resize(size_t count, T const& value) {
Expand Down

0 comments on commit d75f112

Please sign in to comment.