summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Base/Algorithm.h')
-rw-r--r--Swiften/Base/Algorithm.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Swiften/Base/Algorithm.h b/Swiften/Base/Algorithm.h
index 4e68e70..d5edab1 100644
--- a/Swiften/Base/Algorithm.h
+++ b/Swiften/Base/Algorithm.h
@@ -99,6 +99,11 @@ namespace Swift {
target.insert(target.end(), source.begin(), source.end());
}
+ template<typename Source, typename Target>
+ void assign(Target& target, const Source& source) {
+ target.assign(source.begin(), source.end());
+ }
+
template<typename A, typename B, typename C, typename D>
B get(const std::map<A, B, C, D>& map, const A& key, const B& defaultValue) {
typename std::map<A, B, C, D>::const_iterator i = map.find(key);