Can an lvalue reference non-type template parameter be inferred?
<p>I have the following code, which I cannot get to work:</p>
<pre><code>struct foo {};
foo foo1 = {};

template &lt;foo&amp; F&gt;
class FooClass {};

template &lt;foo&amp; F&gt;
void foobar(FooClass&lt;F&gt; arg) {
}

int main() {
    FooClass&lt;foo1&gt; f;
    foobar(f);
}
</code></pre>
<p>The error is:</p>
<blockquote>
<p>main.cpp:14:5: error: no matching function for call to 'foobar'</p>
<p>note: candidate template ignored: substitution failure : deduced non-type template argument does not have the same type as the its corresponding template parameter ('foo' vs 'foo &amp;')</p>
</blockquote>
<p>Is it at all <strong>possible</strong> to infer <em>lvalue</em> reference template parameters? If so, how should it be done?</p>