Feature: Move Semantics
C++ 的移动语义:值类别、移动构造/赋值、转发引用、完美转发、RVO/NRVO 与 std::move 的误用。
C++ 的移动语义:值类别、移动构造/赋值、转发引用、完美转发、RVO/NRVO 与 std::move 的误用。
RAII 用对象生命周期管理资源:规则 0/5、智能指针、异常安全与 scope guard。
C 的类型是对象表示、对齐与合法操作的组合:sizeof 与 offsetof 可算出布局,整数转换按秩与符号进行,数组在表达式里退化为指针,union 与位域则把可移植性押在实现上。
Go 的值模型:基本类型与零值、显式转换和类型身份、常量与 iota 的求值、string/byte/rune 的 UTF-8 边界、slice 头的 len/cap、append 扩容与别名、map 的引用语义、struct 对齐填充、指针复制语义、可比较规则,以及逃逸分析如何决定栈或堆。
Arrays, typed arrays, Map, Set and the weak variants, the iterator and generator protocols that unify them, and the traversal forms whose differences decide correctness.
How CPython compiles and executes a module, how names bind to objects, how reference counting and the cyclic GC decide a lifetime, and how protocols decide identity, equality and attribute access.
One owner per value, borrows checked at compile time, and lifetimes that bound how long a reference stays valid.