aboutsummaryrefslogtreecommitdiffstats
path: root/libdevcore/CommonData.h
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-07-14 07:17:52 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-07-19 21:56:40 +0800
commitf3e591eedd19b181e71682c8dd5d032b52cdced8 (patch)
treeb155c8b298b797a503aa2dd6ff62fc6d6b0a72d8 /libdevcore/CommonData.h
parent89a1e97e7dd8a9af5a5fe2c5530cf4217c79f43b (diff)
downloaddexon-solidity-f3e591eedd19b181e71682c8dd5d032b52cdced8.tar.gz
dexon-solidity-f3e591eedd19b181e71682c8dd5d032b52cdced8.tar.zst
dexon-solidity-f3e591eedd19b181e71682c8dd5d032b52cdced8.zip
Add template for merging sets
Diffstat (limited to 'libdevcore/CommonData.h')
-rw-r--r--libdevcore/CommonData.h6
1 files changed, 6 insertions, 0 deletions
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 <class T, class U> std::vector<T>& operator+=(std::vector<T>& _a, U con
_a.push_back(i);
return _a;
}
+/// Concatenate the contents of a container onto a set
+template <class T, class U> std::set<T>& operator+=(std::set<T>& _a, U const& _b)
+{
+ _a.insert(_b.begin(), _b.end());
+ return _a;
+}
/// Concatenate two vectors of elements.
template <class T>
inline std::vector<T> operator+(std::vector<T> const& _a, std::vector<T> const& _b)