我想知道是否有可能部分专门化模板化方法的行为,以防模板参数之一属于某种类型。
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 */
}
欢迎任何建议。谢谢