clean-code/VectorFiller/atlas/collection/impl/fill_with.h

12 lines
233 B
C++

#pragma once
#include <algorithm>
namespace atlas::collection::detail {
template <typename Iter, typename F>
void fill_with(Iter start, Iter end, F f)
{
std::for_each(start, end, [g = std::move(f)](auto& v) { v = g(); });
}
}