explaingit

isocpp/cppcoreguidelines

45,003CSSAudience · developerComplexity · 1/5MaintainedLicenseSetup · easy

TLDR

A comprehensive guide of best practices and safety rules for writing modern C++ code, maintained by the language's creator and expert community.

Mindmap

mindmap
  root((repo))
    What it does
      Safety rules
      Memory management
      Concurrent code
      Design patterns
    Why it matters
      Prevent crashes
      Avoid leaks
      Catch errors early
    Who uses it
      Learning C++
      Team standards
      Code review
    Key topics
      Interfaces
      Resources
      Object-oriented
      Generic programming

Things people build with this

USE CASE 1

Learn modern C++ idioms and patterns when transitioning from older C++ or other languages.

USE CASE 2

Establish coding standards and best practices for a C++ team or organization.

USE CASE 3

Review and improve safety and correctness of an existing C++ codebase.

USE CASE 4

Configure automated analysis tools to detect violations of the guidelines in your code.

Tech stack

C++11C++14C++17C++20

Getting it running

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice and license text.

In plain English

The C++ Core Guidelines is a document, not executable code, that contains a large collection of best practices, rules, and recommendations for writing C++ programs correctly and safely. C++ is a powerful but notoriously complex programming language where it is easy to accidentally write code that corrupts memory, leaks resources, or behaves unpredictably. The guidelines address these dangers by describing patterns and techniques from modern C++ (C++11 and newer) that help programmers avoid the most common and costly mistakes. The document was created and is maintained by Bjarne Stroustrup, who designed the C++ language itself, along with a large community of C++ experts from multiple organizations. It covers high-level topics such as how to design interfaces, how to manage memory and other resources without leaks, how to write safe concurrent code (code that runs multiple things at once), and how to think about object-oriented and generic programming in C++. Each guideline explains not just what to do but why, with examples of problematic code and the preferred alternative. The rules are designed so that automated analysis tools can check a codebase against them, flagging violations with references to the relevant guideline. You would read the C++ Core Guidelines when learning modern C++, when working to improve the safety and correctness of an existing C++ codebase, or when establishing coding standards for a team. It is especially valuable for developers coming from other languages or older C++ styles (pre-C++11) who want to understand how the language is meant to be used today. The repository itself is a Markdown document; the primary language listed (CSS) refers to the styling of the hosted web version, not a programming language.

Copy-paste prompts

Prompt 1
I'm learning modern C++ and want to understand the Core Guidelines. Which sections should I read first to avoid the most common mistakes?
Prompt 2
How do I use the C++ Core Guidelines to set up automated checking in my CI/CD pipeline?
Prompt 3
Show me examples from the Core Guidelines of how to manage memory safely without manual delete statements.
Prompt 4
What does the C++ Core Guidelines say about writing thread-safe code for concurrent programs?
Prompt 5
I have a legacy C++ codebase. How do I use the Core Guidelines to prioritize which parts to refactor first?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.