From b82b970429640a51ba2649160830b590255adcda Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 19 Mar 2019 17:50:50 +0100 Subject: [PATCH] Add operator for move-append onto set. --- libdevcore/CommonData.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libdevcore/CommonData.h b/libdevcore/CommonData.h index 63a374c30..f587b3533 100644 --- a/libdevcore/CommonData.h +++ b/libdevcore/CommonData.h @@ -55,6 +55,13 @@ template std::set& operator+=(std::set& _a, U const& _b _a.insert(_b.begin(), _b.end()); return _a; } +/// Concatenate the contents of a container onto a set, move variant. +template std::set& operator+=(std::set& _a, U&& _b) +{ + for (auto&& x: _b) + _a.insert(std::move(x)); + return _a; +} /// Concatenate two vectors of elements. template inline std::vector operator+(std::vector const& _a, std::vector const& _b)