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:
parent
2f631f7dc0
commit
cfb8eeebe8
Notes:
sideshowbarker
2024-07-17 20:04:32 +09:00
Author: https://github.com/kleinesfilmroellchen
Commit: cfb8eeebe8
Pull-request: https://github.com/SerenityOS/serenity/pull/12162
Reviewed-by: https://github.com/AtkinsSJ
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