Function References
<p>So I was just working with function pointers and I remembered that you could do this:</p>

<pre><code>void Foo()
{
}

int main()
{
    void(&amp; func)() = Foo;

    func(); //::Foo();
}
</code></pre>

<p>The obvious advantage being that references reference valid objects (unless they're misused), or functions in this case.</p>

<p>The obvious disadvantages being that you can't store an array of references and can't use them for member function pointers (at least as far as I can tell).</p>

<p><strong>My question:</strong> does anyone use them (i.e., <strong>function references</strong>, <em>not</em> function pointers), and if so, in what scenarios have you found them useful/helpful?</p>

<p>The only place I can see them being useful off the bat is binding a reference to a certain function when working with conditional compilation.</p>
