Generic function implementation in C++
<p>I'm working on a new platform and my code is:</p>

<h2>Layer1:</h2>

<pre><code>Call_To_Layer2 (param1, param2);
</code></pre>

<h2>Layer2:</h2>

<pre><code>Call_To_Layer2(param1, param2)
{
    Dispatch_Work_To_Thread(param1, param2);
}

Dispatch_Work_To_Thread(param1, param2)
{
    // create a new thread and execute the task
}
</code></pre>

<p>The function call from Layer1 can have any number of parameters. So how can I design such a method in Layer2?
Dispatch_Work_To_Thread method in layer2 requires the function name as one of the parameters. Since the number of parameters is not constant, how can this be designed?</p>

<p>I have pondered about the design for this problem, but couldn't come up with any solution till now.</p>
