「🎉」 init: hello world !
This commit is contained in:
13
ex01/iter.hpp
Normal file
13
ex01/iter.hpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
template<typename T> void iter(T *arr, int len, void(*func)(T &)) {
|
||||
for (int i = 0; i< len; i++) {
|
||||
func(arr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T> void iter(const T *arr, int len, void(*func)(const T &)) {
|
||||
for (int i = 0; i< len; i++) {
|
||||
func(arr[i]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user