C++, Classes, Const, and strange syntax

后端 未结 8 2124
广开言路
广开言路 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:26

    Your object is not entirely immutable: it's just the reference you created to point to it that's constant.

提交回复
热议问题