The const
is meaningless in that example, and your compiler should give you an error, but if you use it to declare variables of that class between the closing }
and the ;
, then that defines those instances as const
, e.g.:
const class A
{
public:
int x, y;
} anInstance = {3, 4};
// The above is equivalent to:
const A anInstance = {3, 4};
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…