18 namespace iterate_adapters
21 constexpr
auto no_change = []<
class T>(T&& value)
23 return std::forward<T>(value);
48 class filter_t = decltype(filters::always_true),
49 class adapter_t = decltype(iterate_adapters::no_change)>
51 const container_t& container,
52 const callable_t& callable,
53 const filter_t& filter = filters::always_true,
54 const adapter_t& adapter = iterate_adapters::no_change)
56 for (
const auto& element : container)
58 auto adaptedElement = adapter(element);
59 if (filter(adaptedElement) && callable(adaptedElement))
void iterate(const container_t &container, const callable_t &callable, const filter_t &filter=filters::always_true, const adapter_t &adapter=iterate_adapters::no_change)
Iterate container with filter.