From 777852c97d06bd93d0c5a42be0846d98df10609c Mon Sep 17 00:00:00 2001 From: "jaewoo.seo" Date: Fri, 12 May 2017 11:43:27 +0900 Subject: wvalue (json) support vector --- include/crow/json.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include') 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&& v) + { + if (t_ != type::List) + reset(); + t_ = type::List; + if (!l) + l = std::unique_ptr>(new std::vector{}); + l->clear(); + l->resize(v.size()); + size_t idx = 0; + for(auto& x:v) + { + (*l)[idx++] = std::move(x); + } + return *this; + } + template wvalue& operator=(const std::vector& v) { -- cgit v1.2.3-54-g00ecf