diff options
Diffstat (limited to 'Swiften/Base/Algorithm.h')
| -rw-r--r-- | Swiften/Base/Algorithm.h | 9 | 
1 files changed, 7 insertions, 2 deletions
diff --git a/Swiften/Base/Algorithm.h b/Swiften/Base/Algorithm.h index 4d7f1de..4694823 100644 --- a/Swiften/Base/Algorithm.h +++ b/Swiften/Base/Algorithm.h @@ -88,8 +88,8 @@ namespace Swift {  		Detail::eraseIfImpl(container, predicate, typename Detail::ContainerTraits<C>::Category());  	} -	template<typename C> -	void append(C& target, const C& source) { +	template<typename Source, typename Target> +	void append(Target& target, const Source& source) {  		target.insert(target.end(), source.begin(), source.end());  	} @@ -104,6 +104,11 @@ namespace Swift {  		}  	} +	template<typename Container> +	void nullify(Container& c) { +		std::fill(c.begin(), c.end(), 0); +	} +  	/*  	 * Functors  	 */  | 
 Swift