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:
Linus Groh 2021-01-15 20:12:02 +01:00 committed by Andreas Kling
parent 4839f36f5e
commit e83799dc02
Notes: sideshowbarker 2024-07-18 23:47:53 +09:00

View file

@ -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)
{
if (this != &other)