mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
utils: Add insert() convenience templates
This commit is contained in:
parent
07ce278455
commit
173e18a289
1 changed files with 14 additions and 0 deletions
14
src/util.h
14
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
|
||||
|
|
Loading…
Add table
Reference in a new issue