mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
AK: Add JsonArray(const Vector<T>) constructor
This simplifies creating a JsonArray from a Vector<T> (when there's a JsonValue(T) constructor overload for T, that is).
This commit is contained in:
committed by
Andreas Kling
parent
4839f36f5e
commit
e83799dc02
@@ -47,6 +47,13 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
JsonArray(const Vector<T>& vector)
|
||||||
|
{
|
||||||
|
for (auto& value : vector)
|
||||||
|
m_values.append(move(value));
|
||||||
|
}
|
||||||
|
|
||||||
JsonArray& operator=(const JsonArray& other)
|
JsonArray& operator=(const JsonArray& other)
|
||||||
{
|
{
|
||||||
if (this != &other)
|
if (this != &other)
|
||||||
|
|||||||
Reference in New Issue
Block a user