Browse Source

added extend for array list

master
Felix Brendel 5 years ago
parent
commit
33bac14926
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      arraylist.hpp

+ 9
- 0
arraylist.hpp View File

@@ -26,6 +26,15 @@ struct Array_List {
}
}


void extend(std::initializer_list<type> l) {
reserve(l.size());
for (type e : l) {
append(e);
}
}


void dealloc() {
free(data);
data = nullptr;


Loading…
Cancel
Save