I'm kinda new to C++11 and I read this post about functors and It was very helpful, I just thought that is it possible to make a functor that receives more than a single variable? for example we have the class below:
class my_functor{
public:
my_functor(int a,int b):a(a),b(b){}
int operator()(int y)
{
return a*y;
}
private:
int a,b;
};
Now I wonder is there any way that we could make a member function like
operator()(int y)
but with 2 or more (or unknown numbers!) of variables being received?