在模板类中的函数中,我试图区分原始类型和其他类型.
在c ++ 11中,您可以:
if(std::is_fundamental<T>::value) { // Treat it as a primitive } else { //Treat it otherwise }
如果我错了,请纠正我,这不仅仅是在c ++ 11中.
在早期版本的c ++中是否有替代方法?
c++ type-traits c++11
c++ ×1
c++11 ×1
type-traits ×1