mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:37:46 +00:00
AK: Allow constructing a JsonArray from any array-like type
This commit is contained in:
parent
2f631f7dc0
commit
cfb8eeebe8
1 changed files with 4 additions and 3 deletions
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue