Creating a function (of fewer parameters) from another function
<p>I would like to do the following. Say I have this:</p>

<pre><code>void f(const char* c) {
    // Do stuff with c
}

void g(const char* c, int x, int y) {
    // Do other stuff
}
</code></pre>

<p>What I'd like to do is to create a function from g that takes a const char* c. That is:</p>

<pre><code>int a = 5;
int b = 9;
expression(g, a, b)("Hi!");
</code></pre>

<p>Preferably, <code>expression(g)</code> can be stored in a variable as well. I'm not sure how to declare this variable either.</p>

<p>I have tried using boost::bind; however boost::bind returns a boost::function, and I would like a normal C++ function pointer. Additionally, I also saw this thread:
<a href="http://stackoverflow.com/questions/282372/demote-boostfunction-to-a-plain-function-pointer/3453616#3453616">demote boost::function to a plain function pointer</a>
And neither of the top two solution will work. My function f is constrained to take one parameter (no void* user_data pointer). The reason I need this is that I have a third function, h, that takes in a function of one argument, namely a const char* and does things with it. I'd like to be able to pass in a form of g to h.</p>

<pre><code>h(f) // Valid
h(expression(g, a, b)) // Would like for this to be valid, too
</code></pre>

<p>I'm not sure if this is possible, but if it is, do tell :).</p>
