summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AK/Vector.h8
-rw-r--r--Kernel/Makefile2
2 files changed, 9 insertions, 1 deletions
diff --git a/AK/Vector.h b/AK/Vector.h
index e639ba6c1e..2ed2dc7bfc 100644
--- a/AK/Vector.h
+++ b/AK/Vector.h
@@ -3,6 +3,7 @@
#include <AK/Assertions.h>
#include <AK/StdLibExtras.h>
#include <AK/kmalloc.h>
+#include <initializer_list>
#ifndef __serenity__
#include <new>
@@ -64,6 +65,13 @@ public:
clear();
}
+ Vector(std::initializer_list<T> list)
+ {
+ ensure_capacity(list.size());
+ for (auto& item : list)
+ unchecked_append(item);
+ }
+
Vector(Vector&& other)
: m_size(other.m_size)
, m_capacity(other.m_capacity)
diff --git a/Kernel/Makefile b/Kernel/Makefile
index 8579d3bf38..cd90d8c48a 100644
--- a/Kernel/Makefile
+++ b/Kernel/Makefile
@@ -92,7 +92,7 @@ OBJS = $(CXX_OBJS) Boot/boot.ao
KERNEL = kernel
CXXFLAGS += -ffreestanding -mregparm=3 -mno-80387 -mno-mmx -mno-sse -mno-sse2
-CXXFLAGS += -nostdinc++ -nostdlib -nostdinc
+CXXFLAGS += -nostdlib
DEFINES += -DKERNEL
LDFLAGS += -Ttext 0x10000 -Wl,-T linker.ld -nostdlib