descriptionnone
repository URLhttps://github.com/isocpp/CppCoreGuidelines.git
ownerstefan.naewe+rr@gmail.com
last changeThu, 24 Oct 2024 18:51:04 +0000 (24 11:51 -0700)
last refreshThu, 21 Nov 2024 08:21:00 +0000 (21 09:21 +0100)
content tags
add:
README.md

C++ Core Guidelines

"Within C++ is a smaller, simpler, safer language struggling to get out." -- Bjarne Stroustrup

The C++ Core Guidelines are a collaborative effort led by Bjarne Stroustrup, much like the C++ language itself. They are the result of many person-years of discussion and design across a number of organizations. Their design encourages general applicability and broad adoption but they can be freely copied and modified to meet your organization's needs.

Getting started

The guidelines themselves are found at CppCoreGuidelines. The document is in GH-flavored MarkDown. It is intentionally kept simple, mostly in ASCII, to allow automatic post-processing such as language translation and reformatting. The editors maintain one version formatted for browsing. Note that it is manually integrated and can be slightly older than the version in the master branch.

The Guidelines are a constantly evolving document without a strict "release" cadence. Bjarne Stroustrup periodically reviews the document and increments the version number in the introduction. Checkins that increment the version number are tagged in git.

Many of the guidelines make use of the header-only Guidelines Support Library. One implementation is available at GSL: Guidelines Support Library.

Background and scope

The aim of the guidelines is to help people to use modern C++ effectively. By "modern C++" we mean C++11 and newer. In other words, what would you like your code to look like in 5 years' time, given that you can start now? In 10 years' time?

The guidelines are focused on relatively higher-level issues, such as interfaces, resource management, memory management, and concurrency. Such rules affect application architecture and library design. Following the rules will lead to code that is statically type-safe, has no resource leaks, and catches many more programming logic errors than is common in code today. And it will run fast -- you can afford to do things right.

We are less concerned with low-level issues, such as naming conventions and indentation style. However, no topic that can help a programmer is out of bounds.

Our initial set of rules emphasizes safety (of various forms) and simplicity. They may very well be too strict. We expect to have to introduce more exceptions to better accommodate real-world needs. We also need more rules.

You will find some of the rules contrary to your expectations or even contrary to your experience. If we haven't suggested that you change your coding style in any way, we have failed! Please try to verify or disprove rules! In particular, we'd really like to have some of our rules backed up with measurements or better examples.

You will find some of the rules obvious or even trivial. Please remember that one purpose of a guideline is to help someone who is less experienced or coming from a different background or language to get up to speed.

The rules are designed to be supported by an analysis tool. Violations of rules will be flagged with references (or links) to the relevant rule. We do not expect you to memorize all the rules before trying to write code.

The rules are meant for gradual introduction into a code base. We plan to build tools for that and hope others will too.

Contributions and LICENSE

Comments and suggestions for improvements are most welcome. We plan to modify and extend this document as our understanding improves and the language and the set of available libraries improve. More details are found at CONTRIBUTING and LICENSE.

Thanks to DigitalOcean for hosting the Standard C++ Foundation website.

shortlog
2024-10-24 Herb SutterReplace R.5 exception and examples with moving a BigObj... master
2024-10-24 Herb SutterReword 3 occurrences of "special operations"
2024-10-24 Herb SutterFix R.21 warning to cover all Shared_pointer parameters
2024-10-24 arkadyeCorrect grammar for NR.2 (#2228)
2024-10-04 Sergey ZubkovC.20: another example touch-up to comply with C.46
2024-10-04 Sergey ZubkovC.20: rephrase example, re #2212
2024-10-03 Sergey Zubkovupdate date
2024-10-03 Sergey ZubkovC.20: define a ctor to not imply we're forbidding all...
2024-07-02 boyeong-jeonE.16: Fix inconsistent description (#2209)
2024-05-12 Sergey Zubkovwe should be able to publish the page from main branch
2024-05-12 Sergey Zubkovupdate date
2024-05-12 Sergey ZubkovCreate jekyll-gh-pages.yml
2024-05-09 Herb SutterMake exception safety `new` notes consistent, and menti...
2024-05-09 Herb SutterAdd missing links
2024-05-09 Piotr IdzikUpdate link to MISRA C++ Guidelines (#2194)
2024-04-14 Herb SutterAdd note about pointerlike indirections, and remove...
...
tags
7 years ago v0.8
7 years ago v0.7 Adding tag for 0.7
7 years ago v0.6 Adding tag for v0.6
7 years ago v0.1 Adding tag for v0.1
heads
3 weeks ago master
6 months ago gh-pages
10 months ago 2170-hs
3 years ago concrete-terminology
4 years ago cast-to-void-cleanup
4 years ago string_span-excision
5 years ago For-1446
5 years ago es23-updates
6 years ago neilmacintosh-ES70-fix
6 years ago hs-index
7 years ago travis-errors
7 years ago t84-example
7 years ago revert-825-interfaces_non_trivial_fixes
8 years ago H1