diff --git a/arraylist.hpp b/arraylist.hpp index 1619cea..5a56e33 100644 --- a/arraylist.hpp +++ b/arraylist.hpp @@ -26,6 +26,15 @@ struct Array_List { } } + + void extend(std::initializer_list l) { + reserve(l.size()); + for (type e : l) { + append(e); + } + } + + void dealloc() { free(data); data = nullptr;