Invoking a nonconst method on a member from a const method

前端 未结 0 1779
被撕碎了的回忆
被撕碎了的回忆 2020-12-18 02:52

I was surprised to find this \"hole\" in \"const\"ness:

#include 

class A
{
  int r ;
public:
  A():r(0){}

  void nonconst()
  {
    puts( \         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题