Disable template but allow specializations
<p>For example, I have declared a generic template:</p>

<pre><code>template &lt;class T&gt;
void foo(T value);
</code></pre>

<p>But I need that a programmer for every type must declare its specialization:</p>

<pre><code>struct my_user_t
{
// ...
};

template &lt;&gt;
void foo&lt;my_user_t&gt;(my_user_t value) {
  // ...
}

// Somewhere in big program:
my_user_t my_value;
foo(my_value);
</code></pre>

<p>And for now if the programmer forgot to specialize the template for his user type, linker says that it cannot find symbol, not compiler. So in big program it is hard to find where it was used.</p>

<p>How can I declare the template like:</p>

<pre><code>template &lt;class T&gt;
void foo(T value) {
    static_assert(???, "You must specialize foo&lt;&gt; for your type");
}
</code></pre>

<p>such that the compiler (not linker) will say where I used <code>foo(my_user_t)</code> incorrectly?</p>