I know that there are only two kind of types can be initialized in the class declaration, which are enum type and static const interger type. But when I initialize "const int", even the "int", the compilation is still ok. Why?
and why static int type initialization in-class is wrong?
> and why static int type initialization in-class is wrong?
An in-class member initializer for a non-static member is (if required) used by the constructor to perform run-time initialization of the member. (Each object has its own non-static member).