[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-trail-of-bits-modern-cpp":3,"mdc--5k0iy-key":35,"related-org-trail-of-bits-modern-cpp":1651,"related-repo-trail-of-bits-modern-cpp":1807},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":30,"sourceUrl":33,"mdContent":34},"modern-cpp","modernize C++ code to modern idioms","Guides C++ code toward modern idioms (C++20\u002F23\u002F26). Use when writing new C++ code, modernizing legacy patterns, or working on security-critical C++. Replaces raw pointers with smart pointers, SFINAE with concepts, printf with std::print, error codes with std::expected.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"trail-of-bits","Trail of Bits","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Ftrail-of-bits.png","trailofbits",[13,17,20],{"name":14,"slug":15,"type":16},"Security","security","tag",{"name":18,"slug":19,"type":16},"Engineering","engineering",{"name":21,"slug":22,"type":16},"Code Analysis","code-analysis",6139,"https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fskills","2026-08-24T03:57:01.957432",null,541,[29],"agent-skills",{"repoUrl":24,"stars":23,"forks":27,"topics":31,"description":32},[29],"Trail of Bits Claude Code skills for security research, vulnerability detection, and audit workflows","https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Fskills\u002Ftree\u002FHEAD\u002Fplugins\u002Fmodern-cpp\u002Fskills\u002Fmodern-cpp","---\nname: modern-cpp\ndescription: Guides C++ code toward modern idioms (C++20\u002F23\u002F26). Use when writing new C++ code, modernizing legacy patterns, or working on security-critical C++. Replaces raw pointers with smart pointers, SFINAE with concepts, printf with std::print, error codes with std::expected.\n---\n\n# Modern C++\n\nGuide for writing modern C++ using C++20, C++23, and C++26 idioms. Focuses on patterns that eliminate vulnerability classes and reduce boilerplate, with a security emphasis from Trail of Bits.\n\n## When to Use This Skill\n\n- Writing new C++ functions, classes, or libraries\n- Modernizing existing C++ code (pre-C++20 patterns)\n- Choosing between legacy and modern approaches\n- Working on security-critical or safety-sensitive C++\n- Reviewing C++ code for modern idiom adoption\n\n## When NOT to Use This Skill\n\n- **User explicitly requires older standard**: Respect constraints (embedded, legacy ABI)\n- **Pure C code**: This skill is C++-specific\n- **Build system questions**: CMake, Meson, Bazel configuration is out of scope\n- **Non-C++ projects**: Mixed codebases where C++ isn't primary\n\n## Anti-Patterns to Avoid\n\n| Avoid | Use Instead | Why |\n|-------|-------------|-----|\n| `new`\u002F`delete` | `std::make_unique`, `std::make_shared` | Eliminates leaks, double-free |\n| Raw owning pointers | `std::unique_ptr`, `std::shared_ptr` | RAII ownership semantics |\n| C arrays (`int arr[N]`) | `std::array\u003Cint, N>` | Bounds-aware, value semantics |\n| Pointer + length params | `std::span\u003CT>` | Non-owning, bounds-checkable |\n| `printf` \u002F `sprintf` | `std::format`, `std::print` | Type-safe, no buffer overflow |\n| C-style casts `(int)x` | `static_cast\u003Cint>(x)` | Explicit intent, auditable |\n| `#define` constants | `constexpr` variables | Scoped, typed, debuggable |\n| SFINAE \u002F `enable_if` | Concepts + `requires` | Readable constraints and errors |\n| Error codes + out params | `std::expected\u003CT, E>` | Composable, type-safe errors |\n| `union` | `std::variant` | Type-safe, no silent UB |\n| Raw `mutex.lock()\u002Funlock()` | `std::scoped_lock` | Exception-safe, no deadlocks |\n| `std::thread` | `std::jthread` | Auto-join, stop token support |\n| `assert()` macro | `contract_assert` (C++26) | Visible to tooling, configurable |\n| Manual CRTP | Deducing `this` (C++23) | Simpler, no template boilerplate |\n| Macro code generation | Reflection (C++26) | Zero-overhead, composable |\n\nSee [anti-patterns.md](.\u002Freferences\u002Fanti-patterns.md) for the full table (30+ patterns).\n\n## Decision Tree\n\n```\nWhat are you doing?\n|\n+-- Writing new C++ code?\n|   +-- Use modern idioms by default (C++20\u002F23)\n|   +-- Choose the newest standard your compiler supports\n|   +-- See Feature Tiers below\n|\n+-- Modernizing existing code?\n|   +-- Start with Tier 1 (C++20\u002F23) replacements\n|   +-- Prioritize by security impact (memory > types > style)\n|   +-- See anti-patterns.md for the migration table\n|\n+-- Security-critical code?\n|   +-- Enable compiler hardening flags (see below)\n|   +-- Enable hardened libc++ mode\n|   +-- Run sanitizers in CI\n|   +-- See safe-idioms.md and compiler-hardening.md\n|\n+-- Using C++26 features?\n    +-- Reflection: YES, plan for it (GCC 16+)\n    +-- Contracts: cautiously, for new API boundaries\n    +-- std::execution: wait for ecosystem maturity\n    +-- See cpp26-features.md\n```\n\n## Feature Tiers\n\nFeatures are ranked by **practical usability today**, not by standard version.\n\n### Tier 1: Use Today (C++20\u002F23, solid compiler support)\n\n| Feature | Replaces | Standard |\n|---------|----------|----------|\n| Concepts + `requires` | SFINAE, `enable_if` | C++20 |\n| Ranges + views | Raw iterator loops | C++20 |\n| `std::span\u003CT>` | Pointer + length | C++20 |\n| `std::format` | `sprintf`, iostream chains | C++20 |\n| Three-way comparison `\u003C=>` | Manual comparison operators | C++20 |\n| `std::jthread` | `std::thread` + manual join | C++20 |\n| Designated initializers | Positional struct init | C++20 |\n| `std::expected\u003CT,E>` | Error codes, exceptions at boundaries | C++23 |\n| `std::print` \u002F `std::println` | `printf`, `std::cout \u003C\u003C` | C++23 |\n| Deducing `this` | CRTP, const\u002Fnon-const duplication | C++23 |\n| `std::flat_map` | `std::map` for read-heavy use | C++23 |\n| Monadic `std::optional` | Nested if-checks on optionals | C++23 |\n\nSee [cpp20-features.md](.\u002Freferences\u002Fcpp20-features.md) and [cpp23-features.md](.\u002Freferences\u002Fcpp23-features.md).\n\n### Tier 2: Deploy Now (no standard bump needed)\n\nThese improve safety without changing your C++ standard version:\n\n- **Compiler hardening flags** — `-D_FORTIFY_SOURCE=3`, `-fstack-protector-strong`, `-ftrivial-auto-var-init=zero`\n- **Hardened libc++** — `-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST` for ~0.3% overhead bounds-checking\n- **Sanitizers in CI** — ASan + UBSan as minimum; TSan for concurrent code\n- **Warning flags** — `-Wall -Wextra -Wpedantic -Werror`\n\nSee [compiler-hardening.md](.\u002Freferences\u002Fcompiler-hardening.md).\n\n### Tier 3: Plan For (C++26, worth restructuring around)\n\n**Reflection** is the single most transformative C++26 feature. It eliminates:\n- Serialization boilerplate (one generic function replaces per-struct `to_json`)\n- Code generators (protobuf codegen, Qt MOC)\n- Macro-based registration and enum-to-string hacks\n\nGCC 16 (April 2026) has reflection merged. Plan new code to benefit from it.\n\n### Tier 4: Watch (C++26, needs maturation)\n\n- **Contracts** (`pre`\u002F`post`\u002F`contract_assert`) — Better than `assert()`, but no virtual function support and limited compiler support. Adopt cautiously for new API boundaries.\n- **std::execution** (senders\u002Freceivers) — Powerful async framework, but steep learning curve, no scheduler ships with it, and poor documentation. Wait for ecosystem maturity.\n\nSee [cpp26-features.md](.\u002Freferences\u002Fcpp26-features.md).\n\n## Compiler Hardening Quick Reference\n\n### Essential Flags (GCC + Clang)\n\n```\n-Wall -Wextra -Wpedantic -Werror\n-D_FORTIFY_SOURCE=3\n-fstack-protector-strong\n-fstack-clash-protection\n-ftrivial-auto-var-init=zero\n-fPIE -pie\n-Wl,-z,relro,-z,now\n```\n\n### Clang-Specific\n\n```\n-Wunsafe-buffer-usage\n```\n\n### Hardened libc++ (Clang\u002Flibc++ only)\n\n```\n-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST\n```\n\nGoogle deployed this across Chrome and their server fleet: ~0.3% overhead, 1000+ bugs found, 30% reduction in production segfaults.\n\nSee [compiler-hardening.md](.\u002Freferences\u002Fcompiler-hardening.md) for the full guide.\n\n## Rationalizations to Reject\n\n| Rationalization | Why It's Wrong |\n|----------------|----------------|\n| \"It compiles without warnings\" | Warnings depend on which flags you enable. Add `-Wall -Wextra -Wpedantic`. |\n| \"ASan is too slow for production\" | Use GWP-ASan for sampling-based production detection (~0% overhead). |\n| \"We only use safe containers\" | Iterator invalidation and unchecked `optional` access are still exploitable. |\n| \"Smart pointers are slower\" | `std::unique_ptr` has zero overhead vs raw pointers. Measure before claiming. |\n| \"Our code doesn't have memory bugs\" | Google found 1000+ bugs when enabling hardened libc++. So did everyone else. |\n| \"C++26 features aren't available yet\" | C++20\u002F23 features are. Hardening flags work on any standard. Start there. |\n| \"Modern C++ is harder to read\" | `std::expected` is more readable than checking error codes across 5 out-params. |\n\n## Best Practices Checklist\n\n- [ ] Use smart pointers for ownership, raw pointers only for non-owning observation\n- [ ] Prefer `std::span` over pointer + length for function parameters\n- [ ] Use `std::expected` for functions that can fail with typed errors\n- [ ] Constrain templates with concepts, not SFINAE\n- [ ] Enable compiler hardening flags and hardened libc++ in all builds\n- [ ] Run ASan + UBSan in CI; add TSan for concurrent code\n- [ ] Use `constexpr` \u002F `consteval` where possible (UB-free by design)\n- [ ] Mark functions `[[nodiscard]]` when ignoring the return value is likely a bug\n- [ ] Prefer value semantics; use `std::variant` over `union`, `enum class` over `enum`\n- [ ] Initialize all variables at declaration\n\n## Read Next\n\n- [anti-patterns.md](.\u002Freferences\u002Fanti-patterns.md) — Full legacy-to-modern migration table (30+ patterns)\n- [cpp20-features.md](.\u002Freferences\u002Fcpp20-features.md) — Concepts, ranges, span, format, coroutines\n- [cpp23-features.md](.\u002Freferences\u002Fcpp23-features.md) — expected, print, deducing this, flat_map\n- [cpp26-features.md](.\u002Freferences\u002Fcpp26-features.md) — Reflection, contracts, memory safety improvements\n- [compiler-hardening.md](.\u002Freferences\u002Fcompiler-hardening.md) — Flags, sanitizers, hardened libc++\n- [safe-idioms.md](.\u002Freferences\u002Fsafe-idioms.md) — Security patterns by vulnerability class\n",{"data":36,"body":37},{"name":4,"description":6},{"type":38,"children":39},"root",[40,49,55,62,92,98,142,148,610,624,630,642,648,660,667,978,998,1004,1009,1084,1095,1101,1111,1136,1141,1147,1197,1208,1214,1220,1229,1235,1244,1250,1259,1264,1274,1280,1419,1425,1586,1592],{"type":41,"tag":42,"props":43,"children":45},"element","h1",{"id":44},"modern-c",[46],{"type":47,"value":48},"text","Modern C++",{"type":41,"tag":50,"props":51,"children":52},"p",{},[53],{"type":47,"value":54},"Guide for writing modern C++ using C++20, C++23, and C++26 idioms. Focuses on patterns that eliminate vulnerability classes and reduce boilerplate, with a security emphasis from Trail of Bits.",{"type":41,"tag":56,"props":57,"children":59},"h2",{"id":58},"when-to-use-this-skill",[60],{"type":47,"value":61},"When to Use This Skill",{"type":41,"tag":63,"props":64,"children":65},"ul",{},[66,72,77,82,87],{"type":41,"tag":67,"props":68,"children":69},"li",{},[70],{"type":47,"value":71},"Writing new C++ functions, classes, or libraries",{"type":41,"tag":67,"props":73,"children":74},{},[75],{"type":47,"value":76},"Modernizing existing C++ code (pre-C++20 patterns)",{"type":41,"tag":67,"props":78,"children":79},{},[80],{"type":47,"value":81},"Choosing between legacy and modern approaches",{"type":41,"tag":67,"props":83,"children":84},{},[85],{"type":47,"value":86},"Working on security-critical or safety-sensitive C++",{"type":41,"tag":67,"props":88,"children":89},{},[90],{"type":47,"value":91},"Reviewing C++ code for modern idiom adoption",{"type":41,"tag":56,"props":93,"children":95},{"id":94},"when-not-to-use-this-skill",[96],{"type":47,"value":97},"When NOT to Use This Skill",{"type":41,"tag":63,"props":99,"children":100},{},[101,112,122,132],{"type":41,"tag":67,"props":102,"children":103},{},[104,110],{"type":41,"tag":105,"props":106,"children":107},"strong",{},[108],{"type":47,"value":109},"User explicitly requires older standard",{"type":47,"value":111},": Respect constraints (embedded, legacy ABI)",{"type":41,"tag":67,"props":113,"children":114},{},[115,120],{"type":41,"tag":105,"props":116,"children":117},{},[118],{"type":47,"value":119},"Pure C code",{"type":47,"value":121},": This skill is C++-specific",{"type":41,"tag":67,"props":123,"children":124},{},[125,130],{"type":41,"tag":105,"props":126,"children":127},{},[128],{"type":47,"value":129},"Build system questions",{"type":47,"value":131},": CMake, Meson, Bazel configuration is out of scope",{"type":41,"tag":67,"props":133,"children":134},{},[135,140],{"type":41,"tag":105,"props":136,"children":137},{},[138],{"type":47,"value":139},"Non-C++ projects",{"type":47,"value":141},": Mixed codebases where C++ isn't primary",{"type":41,"tag":56,"props":143,"children":145},{"id":144},"anti-patterns-to-avoid",[146],{"type":47,"value":147},"Anti-Patterns to Avoid",{"type":41,"tag":149,"props":150,"children":151},"table",{},[152,176],{"type":41,"tag":153,"props":154,"children":155},"thead",{},[156],{"type":41,"tag":157,"props":158,"children":159},"tr",{},[160,166,171],{"type":41,"tag":161,"props":162,"children":163},"th",{},[164],{"type":47,"value":165},"Avoid",{"type":41,"tag":161,"props":167,"children":168},{},[169],{"type":47,"value":170},"Use Instead",{"type":41,"tag":161,"props":172,"children":173},{},[174],{"type":47,"value":175},"Why",{"type":41,"tag":177,"props":178,"children":179},"tbody",{},[180,224,253,283,305,346,374,404,434,456,482,510,536,566,592],{"type":41,"tag":157,"props":181,"children":182},{},[183,202,219],{"type":41,"tag":184,"props":185,"children":186},"td",{},[187,194,196],{"type":41,"tag":188,"props":189,"children":191},"code",{"className":190},[],[192],{"type":47,"value":193},"new",{"type":47,"value":195},"\u002F",{"type":41,"tag":188,"props":197,"children":199},{"className":198},[],[200],{"type":47,"value":201},"delete",{"type":41,"tag":184,"props":203,"children":204},{},[205,211,213],{"type":41,"tag":188,"props":206,"children":208},{"className":207},[],[209],{"type":47,"value":210},"std::make_unique",{"type":47,"value":212},", ",{"type":41,"tag":188,"props":214,"children":216},{"className":215},[],[217],{"type":47,"value":218},"std::make_shared",{"type":41,"tag":184,"props":220,"children":221},{},[222],{"type":47,"value":223},"Eliminates leaks, double-free",{"type":41,"tag":157,"props":225,"children":226},{},[227,232,248],{"type":41,"tag":184,"props":228,"children":229},{},[230],{"type":47,"value":231},"Raw owning pointers",{"type":41,"tag":184,"props":233,"children":234},{},[235,241,242],{"type":41,"tag":188,"props":236,"children":238},{"className":237},[],[239],{"type":47,"value":240},"std::unique_ptr",{"type":47,"value":212},{"type":41,"tag":188,"props":243,"children":245},{"className":244},[],[246],{"type":47,"value":247},"std::shared_ptr",{"type":41,"tag":184,"props":249,"children":250},{},[251],{"type":47,"value":252},"RAII ownership semantics",{"type":41,"tag":157,"props":254,"children":255},{},[256,269,278],{"type":41,"tag":184,"props":257,"children":258},{},[259,261,267],{"type":47,"value":260},"C arrays (",{"type":41,"tag":188,"props":262,"children":264},{"className":263},[],[265],{"type":47,"value":266},"int arr[N]",{"type":47,"value":268},")",{"type":41,"tag":184,"props":270,"children":271},{},[272],{"type":41,"tag":188,"props":273,"children":275},{"className":274},[],[276],{"type":47,"value":277},"std::array\u003Cint, N>",{"type":41,"tag":184,"props":279,"children":280},{},[281],{"type":47,"value":282},"Bounds-aware, value semantics",{"type":41,"tag":157,"props":284,"children":285},{},[286,291,300],{"type":41,"tag":184,"props":287,"children":288},{},[289],{"type":47,"value":290},"Pointer + length params",{"type":41,"tag":184,"props":292,"children":293},{},[294],{"type":41,"tag":188,"props":295,"children":297},{"className":296},[],[298],{"type":47,"value":299},"std::span\u003CT>",{"type":41,"tag":184,"props":301,"children":302},{},[303],{"type":47,"value":304},"Non-owning, bounds-checkable",{"type":41,"tag":157,"props":306,"children":307},{},[308,325,341],{"type":41,"tag":184,"props":309,"children":310},{},[311,317,319],{"type":41,"tag":188,"props":312,"children":314},{"className":313},[],[315],{"type":47,"value":316},"printf",{"type":47,"value":318}," \u002F ",{"type":41,"tag":188,"props":320,"children":322},{"className":321},[],[323],{"type":47,"value":324},"sprintf",{"type":41,"tag":184,"props":326,"children":327},{},[328,334,335],{"type":41,"tag":188,"props":329,"children":331},{"className":330},[],[332],{"type":47,"value":333},"std::format",{"type":47,"value":212},{"type":41,"tag":188,"props":336,"children":338},{"className":337},[],[339],{"type":47,"value":340},"std::print",{"type":41,"tag":184,"props":342,"children":343},{},[344],{"type":47,"value":345},"Type-safe, no buffer overflow",{"type":41,"tag":157,"props":347,"children":348},{},[349,360,369],{"type":41,"tag":184,"props":350,"children":351},{},[352,354],{"type":47,"value":353},"C-style casts ",{"type":41,"tag":188,"props":355,"children":357},{"className":356},[],[358],{"type":47,"value":359},"(int)x",{"type":41,"tag":184,"props":361,"children":362},{},[363],{"type":41,"tag":188,"props":364,"children":366},{"className":365},[],[367],{"type":47,"value":368},"static_cast\u003Cint>(x)",{"type":41,"tag":184,"props":370,"children":371},{},[372],{"type":47,"value":373},"Explicit intent, auditable",{"type":41,"tag":157,"props":375,"children":376},{},[377,388,399],{"type":41,"tag":184,"props":378,"children":379},{},[380,386],{"type":41,"tag":188,"props":381,"children":383},{"className":382},[],[384],{"type":47,"value":385},"#define",{"type":47,"value":387}," constants",{"type":41,"tag":184,"props":389,"children":390},{},[391,397],{"type":41,"tag":188,"props":392,"children":394},{"className":393},[],[395],{"type":47,"value":396},"constexpr",{"type":47,"value":398}," variables",{"type":41,"tag":184,"props":400,"children":401},{},[402],{"type":47,"value":403},"Scoped, typed, debuggable",{"type":41,"tag":157,"props":405,"children":406},{},[407,418,429],{"type":41,"tag":184,"props":408,"children":409},{},[410,412],{"type":47,"value":411},"SFINAE \u002F ",{"type":41,"tag":188,"props":413,"children":415},{"className":414},[],[416],{"type":47,"value":417},"enable_if",{"type":41,"tag":184,"props":419,"children":420},{},[421,423],{"type":47,"value":422},"Concepts + ",{"type":41,"tag":188,"props":424,"children":426},{"className":425},[],[427],{"type":47,"value":428},"requires",{"type":41,"tag":184,"props":430,"children":431},{},[432],{"type":47,"value":433},"Readable constraints and errors",{"type":41,"tag":157,"props":435,"children":436},{},[437,442,451],{"type":41,"tag":184,"props":438,"children":439},{},[440],{"type":47,"value":441},"Error codes + out params",{"type":41,"tag":184,"props":443,"children":444},{},[445],{"type":41,"tag":188,"props":446,"children":448},{"className":447},[],[449],{"type":47,"value":450},"std::expected\u003CT, E>",{"type":41,"tag":184,"props":452,"children":453},{},[454],{"type":47,"value":455},"Composable, type-safe errors",{"type":41,"tag":157,"props":457,"children":458},{},[459,468,477],{"type":41,"tag":184,"props":460,"children":461},{},[462],{"type":41,"tag":188,"props":463,"children":465},{"className":464},[],[466],{"type":47,"value":467},"union",{"type":41,"tag":184,"props":469,"children":470},{},[471],{"type":41,"tag":188,"props":472,"children":474},{"className":473},[],[475],{"type":47,"value":476},"std::variant",{"type":41,"tag":184,"props":478,"children":479},{},[480],{"type":47,"value":481},"Type-safe, no silent UB",{"type":41,"tag":157,"props":483,"children":484},{},[485,496,505],{"type":41,"tag":184,"props":486,"children":487},{},[488,490],{"type":47,"value":489},"Raw ",{"type":41,"tag":188,"props":491,"children":493},{"className":492},[],[494],{"type":47,"value":495},"mutex.lock()\u002Funlock()",{"type":41,"tag":184,"props":497,"children":498},{},[499],{"type":41,"tag":188,"props":500,"children":502},{"className":501},[],[503],{"type":47,"value":504},"std::scoped_lock",{"type":41,"tag":184,"props":506,"children":507},{},[508],{"type":47,"value":509},"Exception-safe, no deadlocks",{"type":41,"tag":157,"props":511,"children":512},{},[513,522,531],{"type":41,"tag":184,"props":514,"children":515},{},[516],{"type":41,"tag":188,"props":517,"children":519},{"className":518},[],[520],{"type":47,"value":521},"std::thread",{"type":41,"tag":184,"props":523,"children":524},{},[525],{"type":41,"tag":188,"props":526,"children":528},{"className":527},[],[529],{"type":47,"value":530},"std::jthread",{"type":41,"tag":184,"props":532,"children":533},{},[534],{"type":47,"value":535},"Auto-join, stop token support",{"type":41,"tag":157,"props":537,"children":538},{},[539,550,561],{"type":41,"tag":184,"props":540,"children":541},{},[542,548],{"type":41,"tag":188,"props":543,"children":545},{"className":544},[],[546],{"type":47,"value":547},"assert()",{"type":47,"value":549}," macro",{"type":41,"tag":184,"props":551,"children":552},{},[553,559],{"type":41,"tag":188,"props":554,"children":556},{"className":555},[],[557],{"type":47,"value":558},"contract_assert",{"type":47,"value":560}," (C++26)",{"type":41,"tag":184,"props":562,"children":563},{},[564],{"type":47,"value":565},"Visible to tooling, configurable",{"type":41,"tag":157,"props":567,"children":568},{},[569,574,587],{"type":41,"tag":184,"props":570,"children":571},{},[572],{"type":47,"value":573},"Manual CRTP",{"type":41,"tag":184,"props":575,"children":576},{},[577,579,585],{"type":47,"value":578},"Deducing ",{"type":41,"tag":188,"props":580,"children":582},{"className":581},[],[583],{"type":47,"value":584},"this",{"type":47,"value":586}," (C++23)",{"type":41,"tag":184,"props":588,"children":589},{},[590],{"type":47,"value":591},"Simpler, no template boilerplate",{"type":41,"tag":157,"props":593,"children":594},{},[595,600,605],{"type":41,"tag":184,"props":596,"children":597},{},[598],{"type":47,"value":599},"Macro code generation",{"type":41,"tag":184,"props":601,"children":602},{},[603],{"type":47,"value":604},"Reflection (C++26)",{"type":41,"tag":184,"props":606,"children":607},{},[608],{"type":47,"value":609},"Zero-overhead, composable",{"type":41,"tag":50,"props":611,"children":612},{},[613,615,622],{"type":47,"value":614},"See ",{"type":41,"tag":616,"props":617,"children":619},"a",{"href":618},".\u002Freferences\u002Fanti-patterns.md",[620],{"type":47,"value":621},"anti-patterns.md",{"type":47,"value":623}," for the full table (30+ patterns).",{"type":41,"tag":56,"props":625,"children":627},{"id":626},"decision-tree",[628],{"type":47,"value":629},"Decision Tree",{"type":41,"tag":631,"props":632,"children":636},"pre",{"className":633,"code":635,"language":47},[634],"language-text","What are you doing?\n|\n+-- Writing new C++ code?\n|   +-- Use modern idioms by default (C++20\u002F23)\n|   +-- Choose the newest standard your compiler supports\n|   +-- See Feature Tiers below\n|\n+-- Modernizing existing code?\n|   +-- Start with Tier 1 (C++20\u002F23) replacements\n|   +-- Prioritize by security impact (memory > types > style)\n|   +-- See anti-patterns.md for the migration table\n|\n+-- Security-critical code?\n|   +-- Enable compiler hardening flags (see below)\n|   +-- Enable hardened libc++ mode\n|   +-- Run sanitizers in CI\n|   +-- See safe-idioms.md and compiler-hardening.md\n|\n+-- Using C++26 features?\n    +-- Reflection: YES, plan for it (GCC 16+)\n    +-- Contracts: cautiously, for new API boundaries\n    +-- std::execution: wait for ecosystem maturity\n    +-- See cpp26-features.md\n",[637],{"type":41,"tag":188,"props":638,"children":640},{"__ignoreMap":639},"",[641],{"type":47,"value":635},{"type":41,"tag":56,"props":643,"children":645},{"id":644},"feature-tiers",[646],{"type":47,"value":647},"Feature Tiers",{"type":41,"tag":50,"props":649,"children":650},{},[651,653,658],{"type":47,"value":652},"Features are ranked by ",{"type":41,"tag":105,"props":654,"children":655},{},[656],{"type":47,"value":657},"practical usability today",{"type":47,"value":659},", not by standard version.",{"type":41,"tag":661,"props":662,"children":664},"h3",{"id":663},"tier-1-use-today-c2023-solid-compiler-support",[665],{"type":47,"value":666},"Tier 1: Use Today (C++20\u002F23, solid compiler support)",{"type":41,"tag":149,"props":668,"children":669},{},[670,691],{"type":41,"tag":153,"props":671,"children":672},{},[673],{"type":41,"tag":157,"props":674,"children":675},{},[676,681,686],{"type":41,"tag":161,"props":677,"children":678},{},[679],{"type":47,"value":680},"Feature",{"type":41,"tag":161,"props":682,"children":683},{},[684],{"type":47,"value":685},"Replaces",{"type":41,"tag":161,"props":687,"children":688},{},[689],{"type":47,"value":690},"Standard",{"type":41,"tag":177,"props":692,"children":693},{},[694,721,738,758,783,806,831,848,870,907,928,955],{"type":41,"tag":157,"props":695,"children":696},{},[697,706,716],{"type":41,"tag":184,"props":698,"children":699},{},[700,701],{"type":47,"value":422},{"type":41,"tag":188,"props":702,"children":704},{"className":703},[],[705],{"type":47,"value":428},{"type":41,"tag":184,"props":707,"children":708},{},[709,711],{"type":47,"value":710},"SFINAE, ",{"type":41,"tag":188,"props":712,"children":714},{"className":713},[],[715],{"type":47,"value":417},{"type":41,"tag":184,"props":717,"children":718},{},[719],{"type":47,"value":720},"C++20",{"type":41,"tag":157,"props":722,"children":723},{},[724,729,734],{"type":41,"tag":184,"props":725,"children":726},{},[727],{"type":47,"value":728},"Ranges + views",{"type":41,"tag":184,"props":730,"children":731},{},[732],{"type":47,"value":733},"Raw iterator loops",{"type":41,"tag":184,"props":735,"children":736},{},[737],{"type":47,"value":720},{"type":41,"tag":157,"props":739,"children":740},{},[741,749,754],{"type":41,"tag":184,"props":742,"children":743},{},[744],{"type":41,"tag":188,"props":745,"children":747},{"className":746},[],[748],{"type":47,"value":299},{"type":41,"tag":184,"props":750,"children":751},{},[752],{"type":47,"value":753},"Pointer + length",{"type":41,"tag":184,"props":755,"children":756},{},[757],{"type":47,"value":720},{"type":41,"tag":157,"props":759,"children":760},{},[761,769,779],{"type":41,"tag":184,"props":762,"children":763},{},[764],{"type":41,"tag":188,"props":765,"children":767},{"className":766},[],[768],{"type":47,"value":333},{"type":41,"tag":184,"props":770,"children":771},{},[772,777],{"type":41,"tag":188,"props":773,"children":775},{"className":774},[],[776],{"type":47,"value":324},{"type":47,"value":778},", iostream chains",{"type":41,"tag":184,"props":780,"children":781},{},[782],{"type":47,"value":720},{"type":41,"tag":157,"props":784,"children":785},{},[786,797,802],{"type":41,"tag":184,"props":787,"children":788},{},[789,791],{"type":47,"value":790},"Three-way comparison ",{"type":41,"tag":188,"props":792,"children":794},{"className":793},[],[795],{"type":47,"value":796},"\u003C=>",{"type":41,"tag":184,"props":798,"children":799},{},[800],{"type":47,"value":801},"Manual comparison operators",{"type":41,"tag":184,"props":803,"children":804},{},[805],{"type":47,"value":720},{"type":41,"tag":157,"props":807,"children":808},{},[809,817,827],{"type":41,"tag":184,"props":810,"children":811},{},[812],{"type":41,"tag":188,"props":813,"children":815},{"className":814},[],[816],{"type":47,"value":530},{"type":41,"tag":184,"props":818,"children":819},{},[820,825],{"type":41,"tag":188,"props":821,"children":823},{"className":822},[],[824],{"type":47,"value":521},{"type":47,"value":826}," + manual join",{"type":41,"tag":184,"props":828,"children":829},{},[830],{"type":47,"value":720},{"type":41,"tag":157,"props":832,"children":833},{},[834,839,844],{"type":41,"tag":184,"props":835,"children":836},{},[837],{"type":47,"value":838},"Designated initializers",{"type":41,"tag":184,"props":840,"children":841},{},[842],{"type":47,"value":843},"Positional struct init",{"type":41,"tag":184,"props":845,"children":846},{},[847],{"type":47,"value":720},{"type":41,"tag":157,"props":849,"children":850},{},[851,860,865],{"type":41,"tag":184,"props":852,"children":853},{},[854],{"type":41,"tag":188,"props":855,"children":857},{"className":856},[],[858],{"type":47,"value":859},"std::expected\u003CT,E>",{"type":41,"tag":184,"props":861,"children":862},{},[863],{"type":47,"value":864},"Error codes, exceptions at boundaries",{"type":41,"tag":184,"props":866,"children":867},{},[868],{"type":47,"value":869},"C++23",{"type":41,"tag":157,"props":871,"children":872},{},[873,888,903],{"type":41,"tag":184,"props":874,"children":875},{},[876,881,882],{"type":41,"tag":188,"props":877,"children":879},{"className":878},[],[880],{"type":47,"value":340},{"type":47,"value":318},{"type":41,"tag":188,"props":883,"children":885},{"className":884},[],[886],{"type":47,"value":887},"std::println",{"type":41,"tag":184,"props":889,"children":890},{},[891,896,897],{"type":41,"tag":188,"props":892,"children":894},{"className":893},[],[895],{"type":47,"value":316},{"type":47,"value":212},{"type":41,"tag":188,"props":898,"children":900},{"className":899},[],[901],{"type":47,"value":902},"std::cout \u003C\u003C",{"type":41,"tag":184,"props":904,"children":905},{},[906],{"type":47,"value":869},{"type":41,"tag":157,"props":908,"children":909},{},[910,919,924],{"type":41,"tag":184,"props":911,"children":912},{},[913,914],{"type":47,"value":578},{"type":41,"tag":188,"props":915,"children":917},{"className":916},[],[918],{"type":47,"value":584},{"type":41,"tag":184,"props":920,"children":921},{},[922],{"type":47,"value":923},"CRTP, const\u002Fnon-const duplication",{"type":41,"tag":184,"props":925,"children":926},{},[927],{"type":47,"value":869},{"type":41,"tag":157,"props":929,"children":930},{},[931,940,951],{"type":41,"tag":184,"props":932,"children":933},{},[934],{"type":41,"tag":188,"props":935,"children":937},{"className":936},[],[938],{"type":47,"value":939},"std::flat_map",{"type":41,"tag":184,"props":941,"children":942},{},[943,949],{"type":41,"tag":188,"props":944,"children":946},{"className":945},[],[947],{"type":47,"value":948},"std::map",{"type":47,"value":950}," for read-heavy use",{"type":41,"tag":184,"props":952,"children":953},{},[954],{"type":47,"value":869},{"type":41,"tag":157,"props":956,"children":957},{},[958,969,974],{"type":41,"tag":184,"props":959,"children":960},{},[961,963],{"type":47,"value":962},"Monadic ",{"type":41,"tag":188,"props":964,"children":966},{"className":965},[],[967],{"type":47,"value":968},"std::optional",{"type":41,"tag":184,"props":970,"children":971},{},[972],{"type":47,"value":973},"Nested if-checks on optionals",{"type":41,"tag":184,"props":975,"children":976},{},[977],{"type":47,"value":869},{"type":41,"tag":50,"props":979,"children":980},{},[981,982,988,990,996],{"type":47,"value":614},{"type":41,"tag":616,"props":983,"children":985},{"href":984},".\u002Freferences\u002Fcpp20-features.md",[986],{"type":47,"value":987},"cpp20-features.md",{"type":47,"value":989}," and ",{"type":41,"tag":616,"props":991,"children":993},{"href":992},".\u002Freferences\u002Fcpp23-features.md",[994],{"type":47,"value":995},"cpp23-features.md",{"type":47,"value":997},".",{"type":41,"tag":661,"props":999,"children":1001},{"id":1000},"tier-2-deploy-now-no-standard-bump-needed",[1002],{"type":47,"value":1003},"Tier 2: Deploy Now (no standard bump needed)",{"type":41,"tag":50,"props":1005,"children":1006},{},[1007],{"type":47,"value":1008},"These improve safety without changing your C++ standard version:",{"type":41,"tag":63,"props":1010,"children":1011},{},[1012,1042,1059,1069],{"type":41,"tag":67,"props":1013,"children":1014},{},[1015,1020,1022,1028,1029,1035,1036],{"type":41,"tag":105,"props":1016,"children":1017},{},[1018],{"type":47,"value":1019},"Compiler hardening flags",{"type":47,"value":1021}," — ",{"type":41,"tag":188,"props":1023,"children":1025},{"className":1024},[],[1026],{"type":47,"value":1027},"-D_FORTIFY_SOURCE=3",{"type":47,"value":212},{"type":41,"tag":188,"props":1030,"children":1032},{"className":1031},[],[1033],{"type":47,"value":1034},"-fstack-protector-strong",{"type":47,"value":212},{"type":41,"tag":188,"props":1037,"children":1039},{"className":1038},[],[1040],{"type":47,"value":1041},"-ftrivial-auto-var-init=zero",{"type":41,"tag":67,"props":1043,"children":1044},{},[1045,1050,1051,1057],{"type":41,"tag":105,"props":1046,"children":1047},{},[1048],{"type":47,"value":1049},"Hardened libc++",{"type":47,"value":1021},{"type":41,"tag":188,"props":1052,"children":1054},{"className":1053},[],[1055],{"type":47,"value":1056},"-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST",{"type":47,"value":1058}," for ~0.3% overhead bounds-checking",{"type":41,"tag":67,"props":1060,"children":1061},{},[1062,1067],{"type":41,"tag":105,"props":1063,"children":1064},{},[1065],{"type":47,"value":1066},"Sanitizers in CI",{"type":47,"value":1068}," — ASan + UBSan as minimum; TSan for concurrent code",{"type":41,"tag":67,"props":1070,"children":1071},{},[1072,1077,1078],{"type":41,"tag":105,"props":1073,"children":1074},{},[1075],{"type":47,"value":1076},"Warning flags",{"type":47,"value":1021},{"type":41,"tag":188,"props":1079,"children":1081},{"className":1080},[],[1082],{"type":47,"value":1083},"-Wall -Wextra -Wpedantic -Werror",{"type":41,"tag":50,"props":1085,"children":1086},{},[1087,1088,1094],{"type":47,"value":614},{"type":41,"tag":616,"props":1089,"children":1091},{"href":1090},".\u002Freferences\u002Fcompiler-hardening.md",[1092],{"type":47,"value":1093},"compiler-hardening.md",{"type":47,"value":997},{"type":41,"tag":661,"props":1096,"children":1098},{"id":1097},"tier-3-plan-for-c26-worth-restructuring-around",[1099],{"type":47,"value":1100},"Tier 3: Plan For (C++26, worth restructuring around)",{"type":41,"tag":50,"props":1102,"children":1103},{},[1104,1109],{"type":41,"tag":105,"props":1105,"children":1106},{},[1107],{"type":47,"value":1108},"Reflection",{"type":47,"value":1110}," is the single most transformative C++26 feature. It eliminates:",{"type":41,"tag":63,"props":1112,"children":1113},{},[1114,1126,1131],{"type":41,"tag":67,"props":1115,"children":1116},{},[1117,1119,1125],{"type":47,"value":1118},"Serialization boilerplate (one generic function replaces per-struct ",{"type":41,"tag":188,"props":1120,"children":1122},{"className":1121},[],[1123],{"type":47,"value":1124},"to_json",{"type":47,"value":268},{"type":41,"tag":67,"props":1127,"children":1128},{},[1129],{"type":47,"value":1130},"Code generators (protobuf codegen, Qt MOC)",{"type":41,"tag":67,"props":1132,"children":1133},{},[1134],{"type":47,"value":1135},"Macro-based registration and enum-to-string hacks",{"type":41,"tag":50,"props":1137,"children":1138},{},[1139],{"type":47,"value":1140},"GCC 16 (April 2026) has reflection merged. Plan new code to benefit from it.",{"type":41,"tag":661,"props":1142,"children":1144},{"id":1143},"tier-4-watch-c26-needs-maturation",[1145],{"type":47,"value":1146},"Tier 4: Watch (C++26, needs maturation)",{"type":41,"tag":63,"props":1148,"children":1149},{},[1150,1187],{"type":41,"tag":67,"props":1151,"children":1152},{},[1153,1158,1160,1165,1166,1172,1173,1178,1180,1185],{"type":41,"tag":105,"props":1154,"children":1155},{},[1156],{"type":47,"value":1157},"Contracts",{"type":47,"value":1159}," (",{"type":41,"tag":188,"props":1161,"children":1163},{"className":1162},[],[1164],{"type":47,"value":631},{"type":47,"value":195},{"type":41,"tag":188,"props":1167,"children":1169},{"className":1168},[],[1170],{"type":47,"value":1171},"post",{"type":47,"value":195},{"type":41,"tag":188,"props":1174,"children":1176},{"className":1175},[],[1177],{"type":47,"value":558},{"type":47,"value":1179},") — Better than ",{"type":41,"tag":188,"props":1181,"children":1183},{"className":1182},[],[1184],{"type":47,"value":547},{"type":47,"value":1186},", but no virtual function support and limited compiler support. Adopt cautiously for new API boundaries.",{"type":41,"tag":67,"props":1188,"children":1189},{},[1190,1195],{"type":41,"tag":105,"props":1191,"children":1192},{},[1193],{"type":47,"value":1194},"std::execution",{"type":47,"value":1196}," (senders\u002Freceivers) — Powerful async framework, but steep learning curve, no scheduler ships with it, and poor documentation. Wait for ecosystem maturity.",{"type":41,"tag":50,"props":1198,"children":1199},{},[1200,1201,1207],{"type":47,"value":614},{"type":41,"tag":616,"props":1202,"children":1204},{"href":1203},".\u002Freferences\u002Fcpp26-features.md",[1205],{"type":47,"value":1206},"cpp26-features.md",{"type":47,"value":997},{"type":41,"tag":56,"props":1209,"children":1211},{"id":1210},"compiler-hardening-quick-reference",[1212],{"type":47,"value":1213},"Compiler Hardening Quick Reference",{"type":41,"tag":661,"props":1215,"children":1217},{"id":1216},"essential-flags-gcc-clang",[1218],{"type":47,"value":1219},"Essential Flags (GCC + Clang)",{"type":41,"tag":631,"props":1221,"children":1224},{"className":1222,"code":1223,"language":47},[634],"-Wall -Wextra -Wpedantic -Werror\n-D_FORTIFY_SOURCE=3\n-fstack-protector-strong\n-fstack-clash-protection\n-ftrivial-auto-var-init=zero\n-fPIE -pie\n-Wl,-z,relro,-z,now\n",[1225],{"type":41,"tag":188,"props":1226,"children":1227},{"__ignoreMap":639},[1228],{"type":47,"value":1223},{"type":41,"tag":661,"props":1230,"children":1232},{"id":1231},"clang-specific",[1233],{"type":47,"value":1234},"Clang-Specific",{"type":41,"tag":631,"props":1236,"children":1239},{"className":1237,"code":1238,"language":47},[634],"-Wunsafe-buffer-usage\n",[1240],{"type":41,"tag":188,"props":1241,"children":1242},{"__ignoreMap":639},[1243],{"type":47,"value":1238},{"type":41,"tag":661,"props":1245,"children":1247},{"id":1246},"hardened-libc-clanglibc-only",[1248],{"type":47,"value":1249},"Hardened libc++ (Clang\u002Flibc++ only)",{"type":41,"tag":631,"props":1251,"children":1254},{"className":1252,"code":1253,"language":47},[634],"-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST\n",[1255],{"type":41,"tag":188,"props":1256,"children":1257},{"__ignoreMap":639},[1258],{"type":47,"value":1253},{"type":41,"tag":50,"props":1260,"children":1261},{},[1262],{"type":47,"value":1263},"Google deployed this across Chrome and their server fleet: ~0.3% overhead, 1000+ bugs found, 30% reduction in production segfaults.",{"type":41,"tag":50,"props":1265,"children":1266},{},[1267,1268,1272],{"type":47,"value":614},{"type":41,"tag":616,"props":1269,"children":1270},{"href":1090},[1271],{"type":47,"value":1093},{"type":47,"value":1273}," for the full guide.",{"type":41,"tag":56,"props":1275,"children":1277},{"id":1276},"rationalizations-to-reject",[1278],{"type":47,"value":1279},"Rationalizations to Reject",{"type":41,"tag":149,"props":1281,"children":1282},{},[1283,1299],{"type":41,"tag":153,"props":1284,"children":1285},{},[1286],{"type":41,"tag":157,"props":1287,"children":1288},{},[1289,1294],{"type":41,"tag":161,"props":1290,"children":1291},{},[1292],{"type":47,"value":1293},"Rationalization",{"type":41,"tag":161,"props":1295,"children":1296},{},[1297],{"type":47,"value":1298},"Why It's Wrong",{"type":41,"tag":177,"props":1300,"children":1301},{},[1302,1322,1335,1356,1374,1387,1400],{"type":41,"tag":157,"props":1303,"children":1304},{},[1305,1310],{"type":41,"tag":184,"props":1306,"children":1307},{},[1308],{"type":47,"value":1309},"\"It compiles without warnings\"",{"type":41,"tag":184,"props":1311,"children":1312},{},[1313,1315,1321],{"type":47,"value":1314},"Warnings depend on which flags you enable. Add ",{"type":41,"tag":188,"props":1316,"children":1318},{"className":1317},[],[1319],{"type":47,"value":1320},"-Wall -Wextra -Wpedantic",{"type":47,"value":997},{"type":41,"tag":157,"props":1323,"children":1324},{},[1325,1330],{"type":41,"tag":184,"props":1326,"children":1327},{},[1328],{"type":47,"value":1329},"\"ASan is too slow for production\"",{"type":41,"tag":184,"props":1331,"children":1332},{},[1333],{"type":47,"value":1334},"Use GWP-ASan for sampling-based production detection (~0% overhead).",{"type":41,"tag":157,"props":1336,"children":1337},{},[1338,1343],{"type":41,"tag":184,"props":1339,"children":1340},{},[1341],{"type":47,"value":1342},"\"We only use safe containers\"",{"type":41,"tag":184,"props":1344,"children":1345},{},[1346,1348,1354],{"type":47,"value":1347},"Iterator invalidation and unchecked ",{"type":41,"tag":188,"props":1349,"children":1351},{"className":1350},[],[1352],{"type":47,"value":1353},"optional",{"type":47,"value":1355}," access are still exploitable.",{"type":41,"tag":157,"props":1357,"children":1358},{},[1359,1364],{"type":41,"tag":184,"props":1360,"children":1361},{},[1362],{"type":47,"value":1363},"\"Smart pointers are slower\"",{"type":41,"tag":184,"props":1365,"children":1366},{},[1367,1372],{"type":41,"tag":188,"props":1368,"children":1370},{"className":1369},[],[1371],{"type":47,"value":240},{"type":47,"value":1373}," has zero overhead vs raw pointers. Measure before claiming.",{"type":41,"tag":157,"props":1375,"children":1376},{},[1377,1382],{"type":41,"tag":184,"props":1378,"children":1379},{},[1380],{"type":47,"value":1381},"\"Our code doesn't have memory bugs\"",{"type":41,"tag":184,"props":1383,"children":1384},{},[1385],{"type":47,"value":1386},"Google found 1000+ bugs when enabling hardened libc++. So did everyone else.",{"type":41,"tag":157,"props":1388,"children":1389},{},[1390,1395],{"type":41,"tag":184,"props":1391,"children":1392},{},[1393],{"type":47,"value":1394},"\"C++26 features aren't available yet\"",{"type":41,"tag":184,"props":1396,"children":1397},{},[1398],{"type":47,"value":1399},"C++20\u002F23 features are. Hardening flags work on any standard. Start there.",{"type":41,"tag":157,"props":1401,"children":1402},{},[1403,1408],{"type":41,"tag":184,"props":1404,"children":1405},{},[1406],{"type":47,"value":1407},"\"Modern C++ is harder to read\"",{"type":41,"tag":184,"props":1409,"children":1410},{},[1411,1417],{"type":41,"tag":188,"props":1412,"children":1414},{"className":1413},[],[1415],{"type":47,"value":1416},"std::expected",{"type":47,"value":1418}," is more readable than checking error codes across 5 out-params.",{"type":41,"tag":56,"props":1420,"children":1422},{"id":1421},"best-practices-checklist",[1423],{"type":47,"value":1424},"Best Practices Checklist",{"type":41,"tag":63,"props":1426,"children":1429},{"className":1427},[1428],"contains-task-list",[1430,1443,1460,1476,1485,1494,1503,1525,1542,1577],{"type":41,"tag":67,"props":1431,"children":1434},{"className":1432},[1433],"task-list-item",[1435,1441],{"type":41,"tag":1436,"props":1437,"children":1440},"input",{"disabled":1438,"type":1439},true,"checkbox",[],{"type":47,"value":1442}," Use smart pointers for ownership, raw pointers only for non-owning observation",{"type":41,"tag":67,"props":1444,"children":1446},{"className":1445},[1433],[1447,1450,1452,1458],{"type":41,"tag":1436,"props":1448,"children":1449},{"disabled":1438,"type":1439},[],{"type":47,"value":1451}," Prefer ",{"type":41,"tag":188,"props":1453,"children":1455},{"className":1454},[],[1456],{"type":47,"value":1457},"std::span",{"type":47,"value":1459}," over pointer + length for function parameters",{"type":41,"tag":67,"props":1461,"children":1463},{"className":1462},[1433],[1464,1467,1469,1474],{"type":41,"tag":1436,"props":1465,"children":1466},{"disabled":1438,"type":1439},[],{"type":47,"value":1468}," Use ",{"type":41,"tag":188,"props":1470,"children":1472},{"className":1471},[],[1473],{"type":47,"value":1416},{"type":47,"value":1475}," for functions that can fail with typed errors",{"type":41,"tag":67,"props":1477,"children":1479},{"className":1478},[1433],[1480,1483],{"type":41,"tag":1436,"props":1481,"children":1482},{"disabled":1438,"type":1439},[],{"type":47,"value":1484}," Constrain templates with concepts, not SFINAE",{"type":41,"tag":67,"props":1486,"children":1488},{"className":1487},[1433],[1489,1492],{"type":41,"tag":1436,"props":1490,"children":1491},{"disabled":1438,"type":1439},[],{"type":47,"value":1493}," Enable compiler hardening flags and hardened libc++ in all builds",{"type":41,"tag":67,"props":1495,"children":1497},{"className":1496},[1433],[1498,1501],{"type":41,"tag":1436,"props":1499,"children":1500},{"disabled":1438,"type":1439},[],{"type":47,"value":1502}," Run ASan + UBSan in CI; add TSan for concurrent code",{"type":41,"tag":67,"props":1504,"children":1506},{"className":1505},[1433],[1507,1510,1511,1516,1517,1523],{"type":41,"tag":1436,"props":1508,"children":1509},{"disabled":1438,"type":1439},[],{"type":47,"value":1468},{"type":41,"tag":188,"props":1512,"children":1514},{"className":1513},[],[1515],{"type":47,"value":396},{"type":47,"value":318},{"type":41,"tag":188,"props":1518,"children":1520},{"className":1519},[],[1521],{"type":47,"value":1522},"consteval",{"type":47,"value":1524}," where possible (UB-free by design)",{"type":41,"tag":67,"props":1526,"children":1528},{"className":1527},[1433],[1529,1532,1534,1540],{"type":41,"tag":1436,"props":1530,"children":1531},{"disabled":1438,"type":1439},[],{"type":47,"value":1533}," Mark functions ",{"type":41,"tag":188,"props":1535,"children":1537},{"className":1536},[],[1538],{"type":47,"value":1539},"[[nodiscard]]",{"type":47,"value":1541}," when ignoring the return value is likely a bug",{"type":41,"tag":67,"props":1543,"children":1545},{"className":1544},[1433],[1546,1549,1551,1556,1558,1563,1564,1570,1571],{"type":41,"tag":1436,"props":1547,"children":1548},{"disabled":1438,"type":1439},[],{"type":47,"value":1550}," Prefer value semantics; use ",{"type":41,"tag":188,"props":1552,"children":1554},{"className":1553},[],[1555],{"type":47,"value":476},{"type":47,"value":1557}," over ",{"type":41,"tag":188,"props":1559,"children":1561},{"className":1560},[],[1562],{"type":47,"value":467},{"type":47,"value":212},{"type":41,"tag":188,"props":1565,"children":1567},{"className":1566},[],[1568],{"type":47,"value":1569},"enum class",{"type":47,"value":1557},{"type":41,"tag":188,"props":1572,"children":1574},{"className":1573},[],[1575],{"type":47,"value":1576},"enum",{"type":41,"tag":67,"props":1578,"children":1580},{"className":1579},[1433],[1581,1584],{"type":41,"tag":1436,"props":1582,"children":1583},{"disabled":1438,"type":1439},[],{"type":47,"value":1585}," Initialize all variables at declaration",{"type":41,"tag":56,"props":1587,"children":1589},{"id":1588},"read-next",[1590],{"type":47,"value":1591},"Read Next",{"type":41,"tag":63,"props":1593,"children":1594},{},[1595,1604,1613,1622,1631,1640],{"type":41,"tag":67,"props":1596,"children":1597},{},[1598,1602],{"type":41,"tag":616,"props":1599,"children":1600},{"href":618},[1601],{"type":47,"value":621},{"type":47,"value":1603}," — Full legacy-to-modern migration table (30+ patterns)",{"type":41,"tag":67,"props":1605,"children":1606},{},[1607,1611],{"type":41,"tag":616,"props":1608,"children":1609},{"href":984},[1610],{"type":47,"value":987},{"type":47,"value":1612}," — Concepts, ranges, span, format, coroutines",{"type":41,"tag":67,"props":1614,"children":1615},{},[1616,1620],{"type":41,"tag":616,"props":1617,"children":1618},{"href":992},[1619],{"type":47,"value":995},{"type":47,"value":1621}," — expected, print, deducing this, flat_map",{"type":41,"tag":67,"props":1623,"children":1624},{},[1625,1629],{"type":41,"tag":616,"props":1626,"children":1627},{"href":1203},[1628],{"type":47,"value":1206},{"type":47,"value":1630}," — Reflection, contracts, memory safety improvements",{"type":41,"tag":67,"props":1632,"children":1633},{},[1634,1638],{"type":41,"tag":616,"props":1635,"children":1636},{"href":1090},[1637],{"type":47,"value":1093},{"type":47,"value":1639}," — Flags, sanitizers, hardened libc++",{"type":41,"tag":67,"props":1641,"children":1642},{},[1643,1649],{"type":41,"tag":616,"props":1644,"children":1646},{"href":1645},".\u002Freferences\u002Fsafe-idioms.md",[1647],{"type":47,"value":1648},"safe-idioms.md",{"type":47,"value":1650}," — Security patterns by vulnerability class",{"items":1652,"total":1806},[1653,1670,1680,1698,1713,1725,1735,1748,1759,1771,1782,1793],{"slug":1654,"name":1654,"fn":1655,"description":1656,"org":1657,"tags":1658,"stars":23,"repoUrl":24,"updatedAt":1669},"address-sanitizer","detect memory errors during fuzzing","AddressSanitizer detects memory errors during fuzzing. Use when fuzzing C\u002FC++ code to find buffer overflows and use-after-free bugs.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1659,1662,1665,1666],{"name":1660,"slug":1661,"type":16},"C#","c",{"name":1663,"slug":1664,"type":16},"Debugging","debugging",{"name":14,"slug":15,"type":16},{"name":1667,"slug":1668,"type":16},"Testing","testing","2026-07-17T06:05:14.925095",{"slug":1671,"name":1671,"fn":1672,"description":1673,"org":1674,"tags":1675,"stars":23,"repoUrl":24,"updatedAt":1679},"aflpp","perform multi-core fuzzing of C\u002FC++ projects","AFL++ is a fork of AFL with better fuzzing performance and advanced features. Use for multi-core fuzzing of C\u002FC++ projects.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1676,1677,1678],{"name":1660,"slug":1661,"type":16},{"name":14,"slug":15,"type":16},{"name":1667,"slug":1668,"type":16},"2026-07-17T06:05:12.433192",{"slug":1681,"name":1681,"fn":1682,"description":1683,"org":1684,"tags":1685,"stars":23,"repoUrl":24,"updatedAt":1697},"agentic-actions-auditor","audit GitHub Actions for security vulnerabilities","Audits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI, OpenAI Codex, and GitHub AI Inference. Detects attack vectors where attacker-controlled input reaches AI agents running in CI\u002FCD pipelines, including env var intermediary patterns, direct expression injection, dangerous sandbox configurations, and wildcard user allowlists. Use when reviewing workflow files that invoke AI coding agents, auditing CI\u002FCD pipeline security for prompt injection risks, or evaluating agentic action configurations.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1686,1689,1692,1693,1696],{"name":1687,"slug":1688,"type":16},"Agents","agents",{"name":1690,"slug":1691,"type":16},"CI\u002FCD","ci-cd",{"name":21,"slug":22,"type":16},{"name":1694,"slug":1695,"type":16},"GitHub Actions","github-actions",{"name":14,"slug":15,"type":16},"2026-07-18T05:47:48.564744",{"slug":1699,"name":1699,"fn":1700,"description":1701,"org":1702,"tags":1703,"stars":23,"repoUrl":24,"updatedAt":1712},"algorand-vulnerability-scanner","scan Algorand smart contracts for vulnerabilities","Scans Algorand smart contracts for 11 common vulnerabilities including rekeying attacks, unchecked transaction fees, missing field validations, and access control issues. Use when auditing Algorand projects (TEAL\u002FPyTeal).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1704,1707,1708,1709],{"name":1705,"slug":1706,"type":16},"Audit","audit",{"name":21,"slug":22,"type":16},{"name":14,"slug":15,"type":16},{"name":1710,"slug":1711,"type":16},"Smart Contracts","smart-contracts","2026-08-21T03:32:34.227368",{"slug":1714,"name":1714,"fn":1715,"description":1716,"org":1717,"tags":1718,"stars":23,"repoUrl":24,"updatedAt":1724},"atheris","fuzz Python code with Atheris","Atheris is a coverage-guided Python fuzzer based on libFuzzer. Use for fuzzing pure Python code and Python C extensions.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1719,1722,1723],{"name":1720,"slug":1721,"type":16},"Python","python",{"name":14,"slug":15,"type":16},{"name":1667,"slug":1668,"type":16},"2026-08-21T03:32:31.260317",{"slug":1726,"name":1726,"fn":1727,"description":1728,"org":1729,"tags":1730,"stars":23,"repoUrl":24,"updatedAt":1734},"audit-augmentation","augment code graphs with audit findings","Augments Trailmark code graphs with external audit findings from SARIF static analysis results, weAudit annotation files, and version-gated Trailmark 0.4.x binary-analysis graph exports. Maps findings to graph nodes by file and line overlap, creates severity-based subgraphs, and enables cross-referencing findings with pre-analysis data (blast radius, taint, etc.). Use when projecting SARIF results onto a code graph, overlaying weAudit annotations, importing binary graph findings, cross-referencing Semgrep, CodeQL, or binary-analysis findings with call graph data, or visualizing audit findings in the context of code structure.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1731,1732,1733],{"name":1705,"slug":1706,"type":16},{"name":21,"slug":22,"type":16},{"name":14,"slug":15,"type":16},"2026-08-21T03:32:38.432332",{"slug":1736,"name":1736,"fn":1737,"description":1738,"org":1739,"tags":1740,"stars":23,"repoUrl":24,"updatedAt":1747},"audit-context-building","build architectural context for code analysis","Understand a codebase before looking for bugs in it - what each function assumes, what it guarantees, and what it depends on elsewhere. Use when starting an audit, threat model, or architecture review on unfamiliar code, and before any vulnerability-hunting pass.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1741,1744,1745,1746],{"name":1742,"slug":1743,"type":16},"Architecture","architecture",{"name":1705,"slug":1706,"type":16},{"name":21,"slug":22,"type":16},{"name":18,"slug":19,"type":16},"2026-08-08T03:55:04.309014",{"slug":1749,"name":1749,"fn":1750,"description":1751,"org":1752,"tags":1753,"stars":23,"repoUrl":24,"updatedAt":1758},"audit-prep-assistant","prepare codebases for security audits","Prepares codebases for security review using Trail of Bits' checklist. Helps set review goals, runs static analysis tools, increases test coverage, removes dead code, ensures accessibility, and generates documentation (flowcharts, user stories, inline comments).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1754,1755,1756,1757],{"name":1705,"slug":1706,"type":16},{"name":21,"slug":22,"type":16},{"name":18,"slug":19,"type":16},{"name":14,"slug":15,"type":16},"2026-07-18T05:47:39.210985",{"slug":1760,"name":1760,"fn":1761,"description":1762,"org":1763,"tags":1764,"stars":23,"repoUrl":24,"updatedAt":1770},"burpsuite-project-parser","parse Burp Suite project files","Searches and explores Burp Suite project files (.burp) from the command line. Use when searching response headers or bodies with regex patterns, extracting security audit findings, dumping proxy history or site map data, or analyzing HTTP traffic captured in a Burp project.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1765,1766,1769],{"name":1705,"slug":1706,"type":16},{"name":1767,"slug":1768,"type":16},"CLI","cli",{"name":14,"slug":15,"type":16},"2026-07-17T06:05:33.198077",{"slug":1772,"name":1772,"fn":1773,"description":1774,"org":1775,"tags":1776,"stars":23,"repoUrl":24,"updatedAt":1781},"c-review","audit C and C++ code","Performs comprehensive C\u002FC++ security review for memory corruption, integer overflows, race conditions, and platform-specific vulnerabilities. Use when auditing native C\u002FC++ applications, reviewing daemons or services for memory safety, or hunting integer overflow \u002F use-after-free \u002F race conditions in userspace code.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1777,1778,1779,1780],{"name":1705,"slug":1706,"type":16},{"name":1660,"slug":1661,"type":16},{"name":21,"slug":22,"type":16},{"name":14,"slug":15,"type":16},"2026-08-21T03:32:30.26169",{"slug":1783,"name":1783,"fn":1784,"description":1785,"org":1786,"tags":1787,"stars":23,"repoUrl":24,"updatedAt":1792},"cairo-vulnerability-scanner","scan Cairo and StarkNet contracts for vulnerabilities","Scans Cairo\u002FStarkNet smart contracts for 6 critical vulnerabilities including felt252 arithmetic overflow, L1-L2 messaging issues, address conversion problems, and signature replay. Use when auditing StarkNet projects.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1788,1789,1790,1791],{"name":1705,"slug":1706,"type":16},{"name":21,"slug":22,"type":16},{"name":14,"slug":15,"type":16},{"name":1710,"slug":1711,"type":16},"2026-08-21T03:32:39.232318",{"slug":1794,"name":1794,"fn":1795,"description":1796,"org":1797,"tags":1798,"stars":23,"repoUrl":24,"updatedAt":1805},"cargo-fuzz","fuzz Rust projects with cargo-fuzz","cargo-fuzz is the de facto fuzzing tool for Rust projects using Cargo. Use for fuzzing Rust code with libFuzzer backend.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1799,1800,1803,1804],{"name":18,"slug":19,"type":16},{"name":1801,"slug":1802,"type":16},"Rust","rust",{"name":14,"slug":15,"type":16},{"name":1667,"slug":1668,"type":16},"2026-07-17T06:05:18.942184",111,{"items":1808,"total":1856},[1809,1816,1822,1830,1837,1843,1849],{"slug":1654,"name":1654,"fn":1655,"description":1656,"org":1810,"tags":1811,"stars":23,"repoUrl":24,"updatedAt":1669},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1812,1813,1814,1815],{"name":1660,"slug":1661,"type":16},{"name":1663,"slug":1664,"type":16},{"name":14,"slug":15,"type":16},{"name":1667,"slug":1668,"type":16},{"slug":1671,"name":1671,"fn":1672,"description":1673,"org":1817,"tags":1818,"stars":23,"repoUrl":24,"updatedAt":1679},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1819,1820,1821],{"name":1660,"slug":1661,"type":16},{"name":14,"slug":15,"type":16},{"name":1667,"slug":1668,"type":16},{"slug":1681,"name":1681,"fn":1682,"description":1683,"org":1823,"tags":1824,"stars":23,"repoUrl":24,"updatedAt":1697},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1825,1826,1827,1828,1829],{"name":1687,"slug":1688,"type":16},{"name":1690,"slug":1691,"type":16},{"name":21,"slug":22,"type":16},{"name":1694,"slug":1695,"type":16},{"name":14,"slug":15,"type":16},{"slug":1699,"name":1699,"fn":1700,"description":1701,"org":1831,"tags":1832,"stars":23,"repoUrl":24,"updatedAt":1712},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1833,1834,1835,1836],{"name":1705,"slug":1706,"type":16},{"name":21,"slug":22,"type":16},{"name":14,"slug":15,"type":16},{"name":1710,"slug":1711,"type":16},{"slug":1714,"name":1714,"fn":1715,"description":1716,"org":1838,"tags":1839,"stars":23,"repoUrl":24,"updatedAt":1724},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1840,1841,1842],{"name":1720,"slug":1721,"type":16},{"name":14,"slug":15,"type":16},{"name":1667,"slug":1668,"type":16},{"slug":1726,"name":1726,"fn":1727,"description":1728,"org":1844,"tags":1845,"stars":23,"repoUrl":24,"updatedAt":1734},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1846,1847,1848],{"name":1705,"slug":1706,"type":16},{"name":21,"slug":22,"type":16},{"name":14,"slug":15,"type":16},{"slug":1736,"name":1736,"fn":1737,"description":1738,"org":1850,"tags":1851,"stars":23,"repoUrl":24,"updatedAt":1747},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1852,1853,1854,1855],{"name":1742,"slug":1743,"type":16},{"name":1705,"slug":1706,"type":16},{"name":21,"slug":22,"type":16},{"name":18,"slug":19,"type":16},77]