C++, Classes, Const, and strange syntax

后端 未结 8 2107
广开言路
广开言路 2020-12-18 02:14

I was re-reading c++ primer(4th ed.) today - the section on member functions and const references etc, and I came up with this wierd little program:

using st         


        
8条回答
  •  太阳男子
    2020-12-18 02:42

    What you are making const is the reference to a ConstCheater. Nothing in ConstCheater is making value a const.

提交回复
热议问题