Disallow a specific function template instantiation
<p>I would like to define a template function but disallow instantiation with a particular type. Note that in general all types are allowed and the generic template works, I just want to disallow using a few specific types.</p>

<p>For example, in the code below I wish to prevent using <code>double</code> with the template. This doesn't actually prevent the instantiation, but just causes a linker error by not having the function defined.</p>

<pre><code>template&lt;typename T&gt;
T convert( char const * in )
{ return T(); }

//this way creates a linker error
template&lt;&gt;
double convert&lt;double&gt;( char const * in );

int main()
{
    char const * str = "1234";

    int a = convert&lt;int&gt;( str );
    double b = convert&lt;double&gt;( str );
}
</code></pre>

<p><em>The code is just a demonstration, obviously the convert function must do something more.</em></p>

<p><strong>Question:</strong> In the above code how can I produce a compiler error when trying to use the <code>convert&lt;double&gt;</code> instantiation?</p>

<hr>

<p>The closest related question I can find is <a href="http://stackoverflow.com/questions/3926637/how-to-intentionally-cause-a-compile-time-error-on-template-instantiation">How to intentionally cause a compile-time error on template instantiation</a> It deals with a class, not a function.</p>

<p>The reason I need to do this is because the types I wish to block will actually compile and do something with the generic version. That's however not supposed to be part of the contract of the function and may not be supported on all platforms/compilers and in future versions. Thus I'd like to prevent using it at all.</p>
