what does "const" mean when overloading operator in C++

This question already has an answer here:

  • Meaning of “const” last in a C++ method declaration? 7 answers

  • It can be used for any member function, not only operators. It means, that this function will:

  • not be able to modify any data members (except mutable ones)
  • will not be able to call any non- const member functions
  • 链接地址: http://www.djcxy.com/p/40430.html

    上一篇: 函数头后的const是什么?

    下一篇: 在C ++中重载运算符时,“const”是什么意思?