بنقرة واحدة
m15-anti-pattern
Common C++ Anti-Patterns. Triggers: global variables, new/delete, C-style cast, macros, void*.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Common C++ Anti-Patterns. Triggers: global variables, new/delete, C-style cast, macros, void*.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when creating skills for C++20 standard library features, language constructs, remote third-party libraries, or local C++ projects. Keywords: create C++20 skill, create std skill C++, create concept skill, create local C++ skill, 创建 C++20 skill, 创建标准库技能, 创建 concept 技能, 本地库生成 skill, 动态 C++ skill, skill for ranges, skill for coroutines, skill for concepts, generate C++ skill from local path, C++20 技能, 从文档创建 skill, from docs create C++ skill
Mastering C++ Ownership: Move Semantics, RAII, and Reference Safety. Triggers: std::move, use-after-free, double-free, dangling pointer, copy elision, RVO, reference qualifiers.
Mastering C++ Smart Pointers: unique_ptr, shared_ptr, weak_ptr. Triggers: memory management, cycles, enable_shared_from_this, make_unique, make_shared, custom deleters.
Mastering C++ Const Correctness and Mutability. Triggers: const, mutable, logically const, bitwise const, data race, mutex, shared_mutex, thread safety.
Mastering C++ Polymorphism: Templates, Concepts, and Virtual Functions. Triggers: templates, concepts, vtable, CRTP, static polymorphism, dynamic polymorphism, SFINAE.
Mastering C++ Type-Driven Design. Triggers: strong types, phantom types, type state pattern, builder pattern, invalid state unrepresentable.
| name | m15-anti-pattern |
| description | Common C++ Anti-Patterns. Triggers: global variables, new/delete, C-style cast, macros, void*. |
Is this C or C++?
malloc, free, (int)x, void*.std::vector, std::unique_ptr, static_cast, templates.| Issue | Design Question |
|---|---|
| Hard to refactor | Are you using Macros? |
| Leak | Are you using new? |
| UB | Are you using reinterpret_cast? |
Can I delete this new?
make_unique.Can I remove this macro?
constexpr or templates.| Anti-Pattern | Modern Fix |
|---|---|
new T | make_unique<T> |
T* ownership | unique_ptr<T> |
(T)ptr | static_cast<T>(ptr) |
#define | constexpr |