mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00: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: https://github.com/SerenityOS/serenity/commit/cfb8eeebe84 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
|
||||
|
||||
#include <AK/Concepts.h>
|
||||
#include <AK/JsonArraySerializer.h>
|
||||
#include <AK/JsonValue.h>
|
||||
#include <AK/Vector.h>
|
||||
|
@ -27,10 +28,10 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
JsonArray(Vector<T> const& vector)
|
||||
template<IterableContainer ContainerT>
|
||||
JsonArray(ContainerT const& source)
|
||||
{
|
||||
for (auto& value : vector)
|
||||
for (auto& value : source)
|
||||
m_values.append(move(value));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue