INTERACTIVE / 01 · OBJECT LIFETIME
LIFETIME TIMELINE
Step through the code. Watch the object die — and see exactly when a reference becomes a ghost.
SOURCE · ONE LINE AT A TIME
INTERACTIVE / INDEX
FOUR WAYS TO BREAK C++
Same rule every time: step the code, see the failure, repair it.
每次都是同一条规则:走代码、看失败、再修好。
01 / LIFETIME
LIFETIME TIMELINE
A reference outlives its owner. Watch the ghost appear.
引用活得比对象久,看它变成幽灵。
ITERATOR INVALIDATION
A vector grows; the old iterator becomes singular.
vector 增长,旧迭代器变成 singular。
DATA RACE
Two threads, one lost increment, a real TSan report.
两个线程丢掉一次自增,TSan 真实报告。
DOUBLE FREE
The same resource dies twice. ASan catches the second delete.
同一资源死两次,ASan 抓住第二次 delete。