mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
wvalue (json) support vector<wvalue>
This commit is contained in:
parent
4e39b23e45
commit
777852c97d
@ -1264,6 +1264,23 @@ namespace crow
|
||||
return *this;
|
||||
}
|
||||
|
||||
wvalue& operator=(std::vector<wvalue>&& v)
|
||||
{
|
||||
if (t_ != type::List)
|
||||
reset();
|
||||
t_ = type::List;
|
||||
if (!l)
|
||||
l = std::unique_ptr<std::vector<wvalue>>(new std::vector<wvalue>{});
|
||||
l->clear();
|
||||
l->resize(v.size());
|
||||
size_t idx = 0;
|
||||
for(auto& x:v)
|
||||
{
|
||||
(*l)[idx++] = std::move(x);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
wvalue& operator=(const std::vector<T>& v)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user