From f3e591eedd19b181e71682c8dd5d032b52cdced8 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 14 Jul 2017 01:17:52 +0200 Subject: Add template for merging sets --- libdevcore/CommonData.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libdevcore') diff --git a/libdevcore/CommonData.h b/libdevcore/CommonData.h index 4297f606..ab4bfe68 100644 --- a/libdevcore/CommonData.h +++ b/libdevcore/CommonData.h @@ -166,6 +166,12 @@ template std::vector& operator+=(std::vector& _a, U con _a.push_back(i); return _a; } +/// Concatenate the contents of a container onto a set +template std::set& operator+=(std::set& _a, U const& _b) +{ + _a.insert(_b.begin(), _b.end()); + return _a; +} /// Concatenate two vectors of elements. template inline std::vector operator+(std::vector const& _a, std::vector const& _b) -- cgit v1.2.3