Add template for merging sets

This commit is contained in:
Alex Beregszaszi
2017-07-19 14:56:40 +01:00
parent 89a1e97e7d
commit f3e591eedd
2 changed files with 7 additions and 4 deletions
+6
View File
@@ -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)