I have a (free) function template that looks like this
template
T get();
I now want to specialize this function for a class,
As Nawaz said, the standard just doesn't allow you to do that. You could however extract the implementation into the static method of a class and partially specialize that class.
template
struct get_impl{
static T get(){ ... }
};
template
struct get_impl >{
static foo_type get(){ ... }
};
template
T get(){ return get_impl::get(); }