rendered paste body// GenericFunctor.h#include <iostream>class GenericFunctor{public: GenericFunctor(); ~GenericFunctor(); void operator()(void); void SomeFuncA() { std::cout << "GenericFunctor::SomeFuncA()" << std::endl; }; void SomeFuncB() { std::cout << "GenericFunctor::SomeFuncB()" << std::endl; };};// GenericFunctor.cpp#include "GenericFunctor.h"GenericFunctor::GenericFunctor(){}GenericFunctor::~GenericFunctor(){}void GenericFunctor::operator ()(){ static int i = 0; if((i++ % 2) == 0) { SomeFuncA(); SomeFuncB(); }}// main.cpp#include "GenericFunctor.h"int _tmain(int argc, _TCHAR* argv[]){ GenericFunctor f; for(int i = 0; i < 10; i++) { f.operator ()(); } return 0;}// Console outputGenericFunctor::SomeFuncA()GenericFunctor::SomeFuncB()GenericFunctor::SomeFuncA()GenericFunctor::SomeFuncB()GenericFunctor::SomeFuncA()GenericFunctor::SomeFuncB()GenericFunctor::SomeFuncA()GenericFunctor::SomeFuncB()GenericFunctor::SomeFuncA()GenericFunctor::SomeFuncB()// Compiler output, kdyz se nahradi f.operator()() za f.operator()d:\my\gpg\funktory\funktory.cpp(53) : error C3867: 'GenericFunctor::operator ()': function call missing argument list; use '&GenericFunctor::operator ()' to create a pointer to member