#pragma once #include #include "utils/option.hpp" namespace iter { template void for_all(I &&iter, C &&consumer) { auto e = iter.next(); while (e.is_present()) { consumer(e.take()); e = iter.next(); } } template void for_all(std::unique_ptr &&iter, C &&consumer) { auto e = iter->next(); while (e.is_present()) { consumer(e.take()); e = iter->next(); } } }