init commit
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// #include <iostream>
|
||||
// #include <vector>
|
||||
#include <iterator>
|
||||
|
||||
template <typename Container, typename Predicate>
|
||||
Container myfilter(const Container& container, Predicate pred) {
|
||||
Container result;
|
||||
|
||||
for (const auto& x : container) {
|
||||
if (pred(x)) {
|
||||
result.insert(result.end(), x);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user