From 173e18a289088c6087ba6fac708e322aa63b7a94 Mon Sep 17 00:00:00 2001 From: Karl-Johan Alm Date: Tue, 17 Jul 2018 14:05:04 +0900 Subject: [PATCH] utils: Add insert() convenience templates --- src/util.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/util.h b/src/util.h index f8bcc0192..c3003e66a 100644 --- a/src/util.h +++ b/src/util.h @@ -355,4 +355,18 @@ std::string CopyrightHolders(const std::string& strPrefix); */ int ScheduleBatchPriority(void); +namespace util { + +//! Simplification of std insertion +template +inline void insert(Tdst& dst, const Tsrc& src) { + dst.insert(dst.begin(), src.begin(), src.end()); +} +template +inline void insert(std::set& dst, const Tsrc& src) { + dst.insert(src.begin(), src.end()); +} + +} // namespace util + #endif // BITCOIN_UTIL_H