diff options
| author | Karl-Johan Alm <[email protected]> | 2018-07-17 14:05:04 +0900 |
|---|---|---|
| committer | Karl-Johan Alm <[email protected]> | 2018-07-24 15:05:36 +0900 |
| commit | 173e18a289088c6087ba6fac708e322aa63b7a94 (patch) | |
| tree | a1f2e1c3909b8315ebf98f97904dc401b7fbe5d4 /src | |
| parent | Merge #13725: Fix bitcoin-cli --version (diff) | |
| download | discoin-173e18a289088c6087ba6fac708e322aa63b7a94.tar.xz discoin-173e18a289088c6087ba6fac708e322aa63b7a94.zip | |
utils: Add insert() convenience templates
Diffstat (limited to 'src')
| -rw-r--r-- | src/util.h | 14 |
1 files changed, 14 insertions, 0 deletions
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 <typename Tdst, typename Tsrc> +inline void insert(Tdst& dst, const Tsrc& src) { + dst.insert(dst.begin(), src.begin(), src.end()); +} +template <typename TsetT, typename Tsrc> +inline void insert(std::set<TsetT>& dst, const Tsrc& src) { + dst.insert(src.begin(), src.end()); +} + +} // namespace util + #endif // BITCOIN_UTIL_H |