Class's operator() or bind a function as a functor?
问题 There are two ways to make a functor (a function that holds a state): bind a function and define a state: bind(f, _1, state) double g(double x, double state) { return x+state; } function f = bind(g,_1,state); use () operator and a class: struct f { double state; f(double state_):state(state_) {} double operator()(double x) {return x+state;} }; I find that bind -method is faster to write but I'm wondering if there are some hidden stones since most of the time in literature I see functor as