mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-25 05:55:13 +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:
parent
4839f36f5e
commit
e83799dc02
Notes:
sideshowbarker
2024-07-18 23:47:53 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/e83799dc02d Pull-request: https://github.com/SerenityOS/serenity/pull/4963
1 changed files with 7 additions and 0 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue