mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-10-28 19:04:45 +08:00
- const README: rewrite the space-saving claim per issue #5 follow-ups (constant-expression const vs #define immediates; which const qualify as constant expressions) - const README: fix the class-section diagnosis per issue #338 (overload resolution picks the const overload; the restriction only surfaces once that overload is removed) - sizeof README: virtual-inheritance result is compiler-dependent (GCC merges vbptr+vfptr -> 16, MSVC keeps them separate -> 32) #246 - static README: new section on internal linkage / access restriction with anonymous-namespace comparison #142 - 10-day practice: full problem list table + fixed day links #136 - new design_pattern/singleton/singleton_default.hpp: reusable thread-safe CRTP singleton template, compile+concurrency tested #303
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
# 引用与指针那些事
|
||||
> 本文档由 [C++那些事网站](https://light-city.github.io/stories_things/cpp-things/pointer-vs-reference/) 同步生成,网站版本含多语言与更新排版。
|
||||
|
||||
# C++ 指针与引用
|
||||
|
||||
## 关于作者:
|
||||
|
||||
个人公众号:
|
||||
|
||||

|
||||

|
||||
|
||||
## 1.引用与指针
|
||||
|
||||
@@ -171,4 +173,4 @@ End of assembler dump.
|
||||
|
||||
C++中引入了引用操作,在对引用的使用加了更多限制条件的情况下,保证了引用使用的安全性和便捷性,还可以保持代码的优雅性。在适合的情况使用适合的操作,引用的使用可以一定程度避免“指针满天飞”的情况,对于提升程序稳定性也有一定的积极意义。最后,指针与引用底层实现都是一样的,不用担心两者的性能差距。
|
||||
|
||||
上述部分参考自:<http://irootlee.com/juicer_pointer_reference/#>
|
||||
上述部分参考自:<http://irootlee.com/juicer_pointer_reference/#>
|
||||
Reference in New Issue
Block a user