What does “const class” mean?

前端 未结 5 1875
不思量自难忘°
不思量自难忘° 2020-12-14 14:34

After some find and replace refactoring I ended up with this gem:

const class A
{
};

What does \"const class\" mean? It seems to compile ok

5条回答
  •  臣服心动
    2020-12-14 15:12

    If you had this:

    const class A
    {
    } a;
    

    Then it would clearly mean that 'a' is const. Otherwise, I think that it is likely invalid c++.

提交回复
热议问题