diff --git a/include/seastar/json/json_elements.hh b/include/seastar/json/json_elements.hh index 90508f4f2e..ff4a3e25c8 100644 --- a/include/seastar/json/json_elements.hh +++ b/include/seastar/json/json_elements.hh @@ -162,13 +162,22 @@ public: /** * Add an element to the list. - * @param element a new element that will be added to the list + * @param element a new element that will be added to the end of the list */ void push(const T& element) { _set = true; _elements.push_back(element); } + /** + * Move an element into the list. + * @param element a new element that will be added to the list using move-construction + */ + void push(T&& element) { + _set = true; + _elements.push_back(std::move(element)); + } + virtual std::string to_string() override { return formatter::to_json(_elements);