1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 10:18:15 +09:00

AK: Allow constructing a JsonArray from any array-like type

This commit is contained in:
kleines Filmröllchen 2022-01-27 13:03:20 +01:00 committed by Andreas Kling
parent 2f631f7dc0
commit cfb8eeebe8
Notes: sideshowbarker 2024-07-17 20:04:32 +09:00

View file

@ -6,6 +6,7 @@
#pragma once #pragma once
#include <AK/Concepts.h>
#include <AK/JsonArraySerializer.h> #include <AK/JsonArraySerializer.h>
#include <AK/JsonValue.h> #include <AK/JsonValue.h>
#include <AK/Vector.h> #include <AK/Vector.h>
@ -27,10 +28,10 @@ public:
{ {
} }
template<typename T> template<IterableContainer ContainerT>
JsonArray(Vector<T> const& vector) JsonArray(ContainerT const& source)
{ {
for (auto& value : vector) for (auto& value : source)
m_values.append(move(value)); m_values.append(move(value));
} }