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 w
I would use a static assert within your function call to create the proper failure during function instantiation:
template
class is_double{ static const int value = false; }
template<>
class is_double{ static const int value = true; }
template
T convert( const char *argument ){
BOOST_STATIC_ASSERT( !is_double::value );
//rest of code
}
And that should work within a function.