Iván

C++

开发编程v1.0.1
作者:Iván更新于 2026-05-11共 2 个版本 · 最新版本发布于 2026-02-14cpp@clawhub_ivangdavila/cpp
代码审查Bug 修复

据 AlphaMoat 统计,截至 2026-09,C++ 累计下载 2,989 次、获 3 个星标,在全部 5,078 个 AI 技能中排名第 3,736 位,在「开发编程」分类(577 个)中排名第 473 位。

累计安装
197
累计下载
2,989
星标
3
全站排名
#3,736
全站前 74% · 「开发编程」前 82%
平台累计安装累计下载星标评论
ClawHub ↗782,7822-
SkillHub ↗1972,9893—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

主文覆盖 RAII、智能指针、裸指针、容器、并发、现代 C++ 特性和未定义行为等主题,帮助解释或审查代码中的生命周期与所有权问题。

资料发布于 2026-10-27

可以用来做什么

  • 编写或检查 C++ 代码

什么时候用

  • 需要降低内存管理和对象所有权方面的常见错误时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

检查这段 C++ 代码的指针所有权和生命周期问题

月度数据趋势

累计下载2,989
1,1562,1413,1252026-03 · 累计下载 1,2922026-05 · 累计下载 1,8082026-06 · 累计下载 1,9822026-07 · 累计下载 2,2992026-08 · 累计下载 2,5542026-09 · 累计下载 2,98926-0326-09
星标3
2332026-03 · 星标 22026-05 · 星标 32026-06 · 星标 32026-07 · 星标 32026-08 · 星标 32026-09 · 星标 326-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。 该技能有同名的其他版本,调整前的数据归属当前下载量最大的这一个。

月份累计下载环比星标
2026-092,989—3
2026-082,554+11.1%3
2026-072,299+16.0%3
2026-061,982+9.6%3
2026-051,808—3
2026-031,292—2

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

1.7 KB · ClawHub v1.0.1
---
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
展开全部(共 37 行)
| 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

「开发编程」分类下的热门技能

Iván 的其他技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。