cpp07/ex01/Iter.hpp

13 lines
218 B
C++

#ifndef ITER_HPP
#define ITER_HPP
#include <iostream>
template <typename Func, typename Arr>
void iter(Arr *ptr, size_t len, Func fonction)
{
size_t i = 0;
while (i < len)
fonction(ptr[i++]);
}
#endif