wvalue (json) support vector<wvalue>

This commit is contained in:
jaewoo.seo 2017-05-12 11:43:27 +09:00
parent 4e39b23e45
commit 777852c97d

View File

@ -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)
{