| | | | | |

Test Drive 1

struct TestFunctor
{
  void operator() (int i, double d)
  {
    std::cout << "TestFunctor::operator()(" << i << ", " << d << ") called\n"; 
  }
};

int main()
{
  TestFunctor f;
  Functor<void, TYPELIST_2(int, double)> cmd(f);
  // stuff happens here possibly postponing execution of cmd
  cmd(4, 4.5); // output: "TestFunctor::operator()(4, 4.5) called"
}

| | Top of Page | 8. Generalized Functors - 12 of 26