类的函数声明中“ const”最后的含义? - Meaning of 'const' last in a function declaration of a class?

问题:

What is the meaning of const in declarations like these? 像这样的声明中const的含义是什么? The const confuses me. const使我感到困惑。 函数

class foobar
{
  public:
     operator int () const;
     const char* foo() const;
};

解决方案:

参考一: https://stackoom.com/question/39Xt/类的函数声明中-const-最后的含义
参考二: https://oldbug.net/q/39Xt/Meaning-of-const-last-in-a-function-declaration-of-a-class
相关文章
相关标签/搜索