#include <iostream>

struct test1
{
  void operator()(int i)
  {
    std::cout << "[1] " << i << std::endl;
  }
};

void test2(int i)
{
  std::cout << "[2] " << i << std::endl;
}

void test3_impl(int i)
{
  std::cout << "[3] " << i << std::endl;
}
void (*test3)(int) = test3_impl;

template <typename Function>
void call_each(int begin, int end, Function f)
{
  for (int i=begin; i<end; ++i)
    f(i);
}

int main() {
  call_each(1, 4, test1());
  call_each(2, 7, test2);
  call_each(7, 10, test3);
  //call_each(10, 13, [](int i) -> void { std::cout << "[4] " << i << std::endl; });
}
