diff --git a/include/crow/json.h b/include/crow/json.h index 891fedfcb..8b58180c7 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) {