Meaning of 'const' last in a function declaration of a class?

后端 未结 10 2091
无人共我
无人共我 2020-11-21 06:37

What is the meaning of const in declarations like these? The const confuses me.

class foobar
{
  public:
     operator int () const         


        
10条回答
  •  终归单人心
    2020-11-21 07:27

    The const keyword used with the function declaration specifies that it is a const member function and it will not be able to change the data members of the object.

提交回复
热议问题