RosettaCodeData/Task/Repeat/C++/repeat-1.cpp

6 lines
113 B
C++

template <typename Function>
void repeat(Function f, unsigned int n) {
for(unsigned int i=n; 0<i; i--)
f();
}