Index: src/zone/zone.h |
diff --git a/src/zone/zone.h b/src/zone/zone.h |
index 892dfb7f5662a8b551a737535725435a2b39a4f8..4e3b96eb206e8ff1a247130600ea3ac5e341e3c8 100644 |
--- a/src/zone/zone.h |
+++ b/src/zone/zone.h |
@@ -160,6 +160,13 @@ class ZoneList final : public List<T, ZoneAllocationPolicy> { |
ZoneList(int capacity, Zone* zone) |
: List<T, ZoneAllocationPolicy>(capacity, ZoneAllocationPolicy(zone)) {} |
+ // Construct a new ZoneList from a std::initializer_list |
+ ZoneList(std::initializer_list<T> list, Zone* zone) |
+ : List<T, ZoneAllocationPolicy>(static_cast<int>(list.size()), |
+ ZoneAllocationPolicy(zone)) { |
+ for (auto& i : list) Add(i, zone); |
+ } |
+ |
void* operator new(size_t size, Zone* zone) { return zone->New(size); } |
// Construct a new ZoneList by copying the elements of the given ZoneList. |