
Turn data collection into an experience with Typeform. Create beautiful online forms, surveys, quizzes, and so much more. Try it for FREE.

The center for all discussion and news regarding C++.
Turn data collection into an experience with Typeform. Create beautiful online forms, surveys, quizzes, and so much more. Try it for FREE.
Each year, the ISO C++ standards committee and the Standard C++ Foundation run this survey to stay in touch with the worldwide C++ community.
New C++ features in GCC 15
Explore new C++ front-end features in GCC 15.1, including pack indexing and structured binding declaration as a condition
Like every major GCC release, this version will bring many additions, improvements, bug fixes, and new features. GCC 15 is already the system compiler in Fedora 42. Red Hat Enterprise Linux (RHEL) users will get GCC 15 in the Red Hat GCC Toolset. It's also possible to try GCC 15 on Compiler Explorer and similar pages.
This article describes only new features implemented in the C++ front end; it does not discuss developments in the C++ language itself.
The default dialect in GCC 15 is still
-std=gnu++17
. You can use the-std=c++23
or-std=gnu++23
command-line options to enable C++23 features, and similarly for C++26 and others.
In this blog post, we’ll show how to implement a custom pipe operator and apply it to a data processing example. Thanks to C++23 and std::expectedwe can write a rather efficient framework that easily handles unexpected outcomes. This is a collaborative guest post by prof. Bogusław Cyganek: Prof. Cyg...
6 usability improvements in GCC 15
GCC 15 brings better error messages and diagnostics for your code, including prettier execution paths and easier-to-read compiler errors for C++ templates
I work at Red Hat on GCC, the GNU Compiler Collection. I spent most of the past year working on how GCC emits diagnostics (errors and warnings) in the hope of making it easier to use. Let's take a look at 6 improvements to look forward to in the upcoming GCC 15.
- Prettier execution paths
- A new look for C++ template errors
- Machine-readable diagnostics
- An easier transition to C23
- A revamped color scheme
- libgdiagnostics
How to get GCC to optimize this inline function into one multiplcation
#define PI 3.14159 inline double position_from_steps(int steps) { double rotation = (double)steps / 4096.0; return (2.0 * PI * rotation); }; int main(int steps) { double pos = position_from_steps(steps); return (int)pos; }
I am trying to calculate a motor position from an encoder, however that does not really matter. I just checked godbolt.org to see if my inline function compiled into a single multiplication and was pretty disappointed that it didn't. I used -O3 for maximum optimization.
Does somebody know why it does not compile into a single function, or what I had to change to achieve that? You can find my code here: https://godbolt.org/z/qT9srfPT1 .
I know that it does not really matter, but I am curious.
How to Secure Existing C and C++ Software without Memory Safety
The most important security benefit of software memory safety is easy to state: for C and C++ software, attackers can exploit most bugs and vulnerabilities to gain full, unfettered control of software behavior, whereas this is not true for most bugs in memory-safe software—just a few
For more background on safety and security issues related to C++, including definitions of “language safety” and “software security” and similar terms, see my March 2024 essay “C++ safety, in conte…
This is a status update on improvements currently in progress for hardening and securing our C++ software.
In the previous article, we discussed what language features are removed from C++26. In this one, we are going to cover both language features that are finally removed after a few years of deprecation, and also those that are getting deprecated by C++26. As a reminder, a removal from the language us...
How can I choose a different C++ constructor at runtime? - The Old New Thin
Make somebody else do it, and then use copy elision.
First Look at Hazard Pointers (2021)
Hazard pointers are a solution to safe memory reclaimation to lock-free concurrent objects. To motivate the use of hazard pointers, let us consider a problem: we want to implement a concurrent key-value map that satisfy the Write-Rarely-Read-Many (WRRM) property...
Bjarne Stroustrup wants standards body to respond to memory-safety push as Rust monsters lurk at the door
Bjarne Stroustrup, creator of C++, has issued a call for the C++ community to defend the programming language, which has been shunned by cybersecurity agencies and technical experts in recent years for its memory safety shortcomings.
On Saturday, the ISO C++ committee completed the second-last design meeting of C++26, held in Hagenberg, Austria. There is just one meeting left before the C++26 feature set is finalized in June 20…
On Saturday, the ISO C++ committee completed the second-last design meeting of C++26, held in Hagenberg, Austria. There is just one meeting left before the C++26 feature set is finalized in June 2025 and draft C++26 is sent out for its international comment ballot (aka “Committee Draft” or “CD”), and C++26 is on track to be technically finalized two more meetings after that in early 2026.
nocc - A distributed C++ compiler
A distributed C++ compiler: like distcc, but faster - VKCOM/nocc
It is now 45+ years since C++ was first conceived. As planned, it evolved to meet challenges, but many developers use C++ as if it was still the previous millennium. This is suboptimal from the perspective of ease of expressing ideas, performance, reliability, and maintainability. Here, I present the key concepts on which performant, type safe, and flexible C++ software can be built: resource management, life-time management, error-handling, modularity, and generic programming. At the end, I present ways to ensure that code is contemporary, rather than relying on outdated, unsafe, and hard-to-maintain techniques: guidelines and profiles.
Are there any tools counting lines of code AND what those lines are doing?
I've tried a few tools like cloc to count the lines of code within my cpp project.
However, they are pretty surface level and just count the lines.
Is there anything that is able to show how many lines are for classe, imports, simple aliases, typedefs, and more detailed info like that.
My codebase is using C++ 20 modules and a lot of it is just imports and namespace aliases, so just counting the lines is pretty inaccurate. A lot of the files are simply just 10-20 lines at the header for imports, etc, and then just a small child class with constructors.
Which is to say that it's >50% "filler" in a lot of files.
If anyone knows any tools for this, ideally FOSS, please let me know. Thanks!
Contracts for C++ explained in 5 minutes
With P2900, we propose to add contract assertions to the C++ language. This proposal is in the final stages of wording review before being included in the draft Standard for C++26.
Full-text search engine for the C++ Working Draft (and older versions from Tim Song's repository)
Why I’m learning C++
I started programming ten years ago as a hobby. There was a game I wanted to make. I was really just interested in the technical problem of working out the game mechanics. So I read a fantastic textbook about Java and made the basic game as an Android app. I'm embarrassed to admit that I
Poll: How to make sure the caller of your function does not ignore the result?
My boys! We love testing, don't we? More #cpp / #cxx questions for you to sharpen your wits and train your legalese on. Because when it comes to regulations, it's important to not leave anything to chance, even more now that the military says they want to loooooove C++ (in a "why can't you be like R...
(Only half joking with the poll options, too.)
On Saturday, the ISO C++ committee completed the third-last design meeting of C++26, held in Wrocław, Poland. There are just two meetings left before the C++26 feature freeze in June 2025, and C++2…
On Saturday, the ISO C++ committee completed the third-last design meeting of C++26, held in Wrocław, Poland. There are just two meetings left before the C++26 feature freeze in June 2025, and C++26 is on track to be completed two more meetings after that in early 2026. Implementations are closely tracking draft C++26; GCC and Clang already support about two-thirds of C++26 features right now.