64,637
社区成员
发帖
与我相关
我的任务
分享
class TestClass{
public:
TestClass(){}
private:
static const double h= 9.9 ;// c++11下报错;
//错误描述:
//error: 'constexpr' needed for in-class initialization of static data member
//'const double TestClass::h' of non-integral type [-fpermissive]
static constexpr float g = 9.5f; //不报错;
};