Is it ok to pass function objects by reference?
<p>I have a piece of code that requires passing a function object (functional). I can't use function pointers because I need to store some state variables. Let's say I have quite a few state variables. Is it ok to pass the function object by reference? I've only seen function objects passed by value. This is what my code will look like:</p>

<pre><code>struct FunctionObject {
    double a, b, x, y;
    double operator() (int v, int w) {....}
};

template &lt;class T&gt;
Class MyClass {
     T&amp; func;
     .....
public:
     MyClass(T&amp; func):func(func) {}
     .....
};
</code></pre>
