#include "learn.hpp"

funinc::funinc (int a)
{
  y = a;
}
int funinc::operator () (int x) const 
{ 
  return x+1; 
}

int fundec::operator () (int a)
{
  return a - 1;
}

    funfib::funfib(int a)
    {
      cnt = a;
    }
    int funfib::operator () (int a, int b) const
    {
      if (cnt > 0)
      {
        funfib tmp (cnt-1);
        return tmp(b,a+b);
      }
      else
      {
        return a+b;
      }
    }
    
  void funhello::operator () ()
  {
    std::cout << "hello\n";
  }
  
  void funhi::operator () ()
  {
    std::cout << "hi\n";
  }