25 lines
339 B
C++
25 lines
339 B
C++
#include "iter.hpp"
|
|
#include <iostream>
|
|
|
|
template<typename T>
|
|
void print(T& t)
|
|
{
|
|
std::cout << t << std::endl;
|
|
}
|
|
|
|
int main()
|
|
{
|
|
int array[] = {0, 1, 2, 3, 4, 5, 6};
|
|
|
|
iter(array, 7, print<int>);
|
|
|
|
std::string strs[] = {
|
|
"Hello World",
|
|
"Bonjour Monde",
|
|
"Hallo Welt",
|
|
"Hola Mundo"
|
|
};
|
|
|
|
iter(strs, 4, print<std::string>);
|
|
|
|
} |