typedef struct
{
int a;
}TestType;
int main()
{
enable_if <1, TestType>::type test1; //正确
test1.a = 100;
enable_if <is_integral<int>::value, TestType>::type test2; //正确
test1.a = 100;
enable_if <0, TestType>::type test3; //错误
test1.a = 100;
enable_if <is_integral<float>::value, TestType>::type test4; //错误
}
enable_if
最新推荐文章于 2024-08-06 23:04:18 发布