I’m wondering if it is anyhow possible to partially specialize a templated method behaviour in case one of the template parameter it’s of a certain type.
template<class T>
void Foo(T& parameter)
{
/* some generic - all types - stuff */
If(T is int) // this is pseudo-code, typeinfo? Boost?
{
/* some specific int processing which might not compile with other types */
}
/* again some common stuff */
}
Any suggestion is welcome.
Thanks
If you only want to specialize a part of the function then you simply have to factor out the part of the function with specialized implementations: