Merge pull request #229 from JaewooSeo/wvalue_vector

wvalue (json) support vector<wvalue>
This commit is contained in:
Jaeseung Ha 2017-09-17 12:40:05 +09:00 committed by GitHub
commit 2564c62778

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