Invoking a nonconst method on a member from a const method

前端 未结 0 499
孤街浪徒
孤街浪徒 2020-12-18 02:59

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

#include 

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

  void nonconst()
  {
    puts( \         


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