utils: Add insert() convenience templates

This commit is contained in:
Karl-Johan Alm 2018-07-17 14:05:04 +09:00
parent 07ce278455
commit 173e18a289
No known key found for this signature in database
GPG key ID: 57AF762DB3353322

View file

@ -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