#include #include #include template void myapply(It first, It last, F f) { for (It it = first; it != last; ++it) { f(*it); } return; } template std::vector::value_type>> myfilter2(It first, It last, Pred f) { std::vector::value_type>> result; for (It it = first; it != last; ++it) { if (f(*it)) { result.push_back(std::ref(*it)); } } return result; }