From e83799dc02dfd092cf8970e7df587cd24eadc25c Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Fri, 15 Jan 2021 20:12:02 +0100 Subject: [PATCH] AK: Add JsonArray(const Vector) constructor This simplifies creating a JsonArray from a Vector (when there's a JsonValue(T) constructor overload for T, that is). --- AK/JsonArray.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/AK/JsonArray.h b/AK/JsonArray.h index 5d9fe62abb8..aea8601f346 100644 --- a/AK/JsonArray.h +++ b/AK/JsonArray.h @@ -47,6 +47,13 @@ public: { } + template + JsonArray(const Vector& vector) + { + for (auto& value : vector) + m_values.append(move(value)); + } + JsonArray& operator=(const JsonArray& other) { if (this != &other)