2 c++ arithmetic-expressions matrix char
我创建了一个Matrix类,使用
static_assert(std::is_arithmetic<T>::value,"");
Run Code Online (Sandbox Code Playgroud)
检查模板类型是否为算术类型.所以我尝试了
Matrix<char> matrix1(3,3); // ctor takes number of rows and columns
Run Code Online (Sandbox Code Playgroud)
它的工作原理.不使用char类型调用static_assert函数.这是正常的?char看起来像算术类型?