Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

谈谈 C++ 中的 const - Luyu Huang's Tech Blog #66

Open
luyuhuang opened this issue May 9, 2022 · 0 comments
Open

谈谈 C++ 中的 const - Luyu Huang's Tech Blog #66

luyuhuang opened this issue May 9, 2022 · 0 comments

Comments

@luyuhuang
Copy link
Owner

https://luyuhuang.tech/2022/05/10/cpp-const.html

C++ 用关键字 const 标识一个类型不可变. 这其实很容易理解. 不过, 对于 C++ 而言, 简单的概念也有很多可以讨论的. 我们来看一个问题.问题我们知道 const 可以用于修饰成员函数, 标识这个函数不能修改这个类的数据. 假设一个类有一个指针类型的成员 T *p, 我们希望通过 get() 方法获...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant