Iván
作者: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
累計下載
2989
星標
3
全站排名
#3,736
全站前 74% · 「開發程式設計」前 82%
平台累計安裝累計下載星標評論
ClawHub ↗7827822-
SkillHub ↗19729893—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

主文覆蓋 RAII、智慧指標、裸指標、容器、併發、現代 C++ 特性和未定義行為等主題,幫助解釋或審查程式碼中的生命週期與所有權問題。

資料釋出於 2026-10-27

可以用來做什麼

  • 編寫或檢查 C++ 程式碼

什麼時候用

  • 需要降低記憶體管理和物件所有權方面的常見錯誤時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

檢查這段 C++ 程式碼的指標所有權和生命週期問題

月度資料趨勢

累計下載2989
1156214131252026-03 · 累計下載 12922026-05 · 累計下載 18082026-06 · 累計下載 19822026-07 · 累計下載 22992026-08 · 累計下載 25542026-09 · 累計下載 298926-0326-09
星標3
2332026-03 · 星標 22026-05 · 星標 32026-06 · 星標 32026-07 · 星標 32026-08 · 星標 32026-09 · 星標 326-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。 該技能有同名的其他版本,調整前的資料歸屬當前下載量最大的這一個。

月份累計下載環比星標
2026-092989—3
2026-082554+11.1%3
2026-072299+16.0%3
2026-061982+9.6%3
2026-051808—3
2026-031292—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),按月更新。口徑說明見資料方法。