enable_if
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; //錯誤
}
總結
- 上一篇: linux内存管理的主要概念是虚拟内存,
- 下一篇: 民生女人花信用卡年费多少