type Cls::func() const;中const的意义

type Cls::func() const;中const的意义:

不能对成员进行赋值。即类中此成员函数,你不希望它能修改此类任何一个成员变量,则可以如此使用。

posted @ 2022-03-26 10:22  levylaw  阅读(20)  评论(0编辑  收藏  举报