Index: src/Common/utility.h
===================================================================
--- src/Common/utility.h	(revision 834b89258d7f4a00204b5a1203c6de5a5161498f)
+++ src/Common/utility.h	(revision 54c9000e4efa1fe5278b3e7542f24426b99cc070)
@@ -98,4 +98,14 @@
 }
 
+template< typename SrcContainer, typename DestContainer, typename Predicate >
+void cloneAll_if( const SrcContainer &src, DestContainer &dest, Predicate pred ) {
+	std::back_insert_iterator< DestContainer > out( dest );
+	for ( auto x : src ) {
+		if ( pred(x) ) {
+			*out++ = x->clone();
+		}
+	} // while
+}
+
 template< typename Container >
 void assertAll( const Container &container ) {
