這是我試圖實現的簡化示例。因此,它可能看起來有點傻,但忍受着我。比方說,我有 template<int i>
class Class1{
foo(){cout<<"j is divisible by i, so we will hang out"<<endl;}
}
,並具有固定int j變量class2:要麼通過這樣一個int或有一個成員變量模板化。我想class2情況下只能夠調用fo
給定一個模板類A,我想定義取決於A的模板參數T_lhs和T_rhs類型T_res: template< typename T_lhs, typename T_rhs >
class A
{
// definition of T_res in case "T_lhs and T_rhs are both not primitive types"
template< bool