AgentMarketMCP / SKILL 资产档案馆

目录 / C++

SKILL 未评级 已上架

C++

--- name: C++ slug: cpp version: 1.0.1 description: Write safe C++ avoiding memory leaks, dangling pointers, undefined behavior, and ownership confusion. metadata: {"clawdbot":{"emoji":"⚡","requires":{"bins":["g++"]},"os":["linux","darwin","win32"]}} --- ## Quick Reference | Topic | File | |-------|------| | RAII, smart pointers, new/delete | `memory.md` | | Raw pointers, references, nullptr | `pointers.md` | | Rule of 3/5/0, inheritance, virtual | `classes.md` | | Containers, iterators, algorithms | `stl.md` | | Templates, SFINAE, concepts | `templates.md` | | Threads, mutex, atomics | `concurrency.md` | | C++11/14/17/20, move semantics | `modern.md` | | Undefined behavior traps | `ub.md` | ## Critical Rules - Raw `new` without `delete` leaks — use `std::unique_ptr` or `std::make_unique` - Returning reference to local — undefined behavior, object destroyed on return - `==` for C-strings compares pointers — use `std::string` or `strcmp()` - Signed integer overflow is UB — not wrap-around like unsigned - Virtual destructor required in base class — otherwise derived destructor skipped - `std::move` doesn't move — it casts to rvalue, enabling move semantics - Moved-from object valid but unspecified — don't use without reassigning - Data race on non-atomic is UB — use `std::mutex` or `std::atomic` - `vector<bool>` is not a real container — returns proxy, use `deque<bool>` - `map[key]` inserts default if missing — use `find()` or `contains()` to check - Braced init `{}` prevents narrowing — `int x{3.5}` errors, `int x(3.5)` truncates - Iterator invalidation on `push_back` — vector may relocate, invalidating iterators - `string_view` doesn't own data — underlying string must outlive the view

模型生成摘要(rules/v1 · 2026-10-01 11:05):---
这是模型对公开材料的总结,不是官方声明,请以原链内容为准。

存档时间线

版本存档时间内容哈希内容
v52026-09-28 17:52001aa811 已过保留期
v62026-09-29 02:324320250e 已过保留期
v72026-09-28 21:28001aa811 已过保留期
v82026-09-29 12:074320250e 已过保留期
v92026-09-29 16:22001aa811 已过保留期
v102026-09-30 04:114320250e 已过保留期
v112026-09-30 11:27001aa811 已过保留期
v122026-09-30 23:344320250e 已过保留期
v132026-10-01 06:32001aa811 已过保留期
v142026-10-01 18:154320250e 可取

版本索引永久保留;内容副本只保留最新 1 份,更早版本仅留索引与哈希(存档时间线的证据链不会因此断裂)。

下载存档内容副本

纠错与举报(发现条目失效、署名有误或涉及侵权?)
提交举报 / 纠错

侵权举报经核验成立后,我们会即时下线该条目并删除已存的内容副本。