aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorjaewoo.seo <jaewoo.seo@ngine.co.kr>2017-05-12 11:43:27 +0900
committerjaewoo.seo <jaewoo.seo@ngine.co.kr>2017-05-12 11:43:27 +0900
commit777852c97d06bd93d0c5a42be0846d98df10609c (patch)
tree33366080d6e193cb5867e87d223e16f10c446034 /include
parent4e39b23e455e455f1878b3e68d729a1737f3e431 (diff)
downloadcrow-777852c97d06bd93d0c5a42be0846d98df10609c.tar.gz
crow-777852c97d06bd93d0c5a42be0846d98df10609c.zip
wvalue (json) support vector<wvalue>
Diffstat (limited to 'include')
-rw-r--r--include/crow/json.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/crow/json.h b/include/crow/json.h
index 891fedf..8b58180 100644
--- a/include/crow/json.h
+++ b/include/crow/json.h
@@ -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)
{