C++ Passing unknown function as an agument
<p>My problem is following, I have a function which takes one function as a parameter. The problem is that in some cases the passed function fEval() needs to be called with two parameters instead of one as fEval(somevalue1,somevalue2)</p>

<pre><code>Func(double (*fEval)(double F1),double min, double max,...)
{
    double value1 = fEval(10);

    // do something here

    double value2 = fEval(20,30);
}
</code></pre>

<p>So what would be the correct way to implement Func function ?
I know I can't do it either</p>

<pre><code>Func(double (*fEval)(double F1),double min, double max,...)
</code></pre>

<p>or</p>

<pre><code>Func(double (*fEval)(double F1,double F2),double min, double max,...)
</code></pre>

<p>Thanks !</p>

<p>Okay let me rephrase the problem. I need to create a function which could take a one unknown function as a first parameter, two different values and an argument list.
Something like</p>

<pre><code>double Function(RandomFunction, val1, val2, ...);
</code></pre>

<p>The random function will be either:</p>

<pre><code>double Func1(double x)
{
    m_x = x;
    //Calling function
    // Set other things
}
double Func2(double x,double y)
{
    m_y = y;
    m_x = x;
    //Calling function
    // Set other things
}
</code></pre>

<p>I'll try that functor way but I'm not sure is it right way to do this ? Doesn't it require me to overload () inside of the possible functions what could be called ?</p>
