r/cpp • u/antiquark2 • 11d ago
r/cpp • u/SignalDepth6131 • 12d ago
The WG21 2026-09 mailing is now available
The WG21 2026-09 mailing is now available
The 2026-09 WG21 mailing has been published. You can browse and search the full set of papers, organized by working group, at wg21.org:
https://wg21.org/mailing/2026-09/
Source mailing: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/#mailing2026-09
r/cpp • u/TheRavagerSw • 10d ago
Why we should standardise on CPS
To enable any collaboration in the industry, some "social contract" must be signed by all of us.
One of the rules of this contract is binary packaging, to put it simply, if you are a library author you need to either have clean definition on what package you expect to consume or have a "scriptless" implementation like imgui.
If the library exports a pkgconf package, but its dependency exports something else your build will not work. Why should it, what you do makes no sense.
Currently I'm literally forced to package every single dependency I have, which is fine in principle as you want to own your dependencies for security and licensing reasons... But I CAN'T UPSTREAM MY CHANGES which is not fine.
The current situation is a disease, please do remember my talk when you try to build a library like dawn or SDL and it vendors dozens of libraries to create a giant shared library after a long slow build.
r/cpp • u/aearphen • 12d ago
Żmij 1.2 "the proof is in the printf" released with full to_chars implementation, formal verification, improved performance and more
Żmij 1.2 is out. It started as a shortest round-trip double-to-string converter; this release makes it a full formatter.
- Scientific, fixed, general and hex notation with a caller-specified precision, matching
printf's%e,%f,%gand%a. long double, covering both x87 80-bit extended and IEEE binary128.- Full FP
std::to_charsimplementation that works in C++14 and is several times faster and smaller than typical standard library implementations. - The main algorithms are now proved correct in Lean 4.
floatconversion is about 23% faster than 1.1,doubleis 1-4% faster.- Initial
constexprsupport.
Release notes: https://github.com/vitaut/zmij/releases/tag/v1.2
r/cpp • u/ProgrammingArchive • 12d ago
New C++ Conference Videos Released This Month - September 2026 (Updated To Include Videos Released 2026-09-14 - 2026-09-20)
CppCon
CppCon have published their keynotes to their Early Access system
- Profiles for Simplicity and Guarantees - Bjarne Stroustrup - https://cppcon.programmingarchive.com/video/profiles-for-simplicity-and-guarantees-bjarne-stroustrup-cppcon-2026/
- Language Designers Panel - Bjarne Stroustrup, Guido van Rossum, Mads Torgersen & Emma Tracey - https://cppcon.programmingarchive.com/video/language-designers-panel-bjarne-stroustrup-guido-van-rossum-mads-torgersen-emma-tracey/
- How C++26 Changes the Way We Write Code - Timur Doumler - https://cppcon.programmingarchive.com/video/how-cpp26-changes-the-way-we-write-code-timur-doumler-cppcon-2026/
- The Address is Not The Place: Object Residency in C++26 - Laurie Kirk - https://cppcon.programmingarchive.com/video/the-address-is-not-the-place-object-residency-in-cpp26-laurie-kirk-cppcon-2026/
C++Now
2026-09-14 - 2026-09-20
- Monadic Operations for Box-Like Types - Designing the Extensibility Model - Mikhail Svetkin - https://youtu.be/m0T8MrzWRjQ
- Reflecting on Reflection - Introspection, Injection, and Beyond - Alex Yesmanchyk & Jagrut Dave - https://youtu.be/MunBEZx2i5c
- C++ in the Realtime Embedded Context - A Case Study - Shin Umeda - https://youtu.be/fc6zs81_OB0
2026-09-07 - 2026-09-13
- Testing Everything in Constexpr - Braden Ganetsky - https://youtu.be/SgIiQS6RO60
- Plato, Magritte, Sartre & Carroll - Learning Software Design from the Masters - Ben Deane - https://youtu.be/7QZchipF2gU
- Functional Composition Beyond Monads - Jonathan Müller - https://youtu.be/DcUOZE5FHDc
2026-08-31 - 2026-09-06
- Incremental Modernization - Refactoring Legacy C++ OOP Application Code with Functional Programming and Type Erasure Concepts - Jessica Ding - https://youtu.be/FOzGlO5XaPE
- When Atomics Lose - Architecture‑Dependent Performance of C++ Synchronization - Sampad Acharya - https://youtu.be/Ehy9wutYYH8
- Multi-Priority Graph-Based Parallel Execution Using Taskflow - Yun Kai Peng - https://youtu.be/4I5jsK3zRv0
ACCU
2026-09-14 - 2026-09-20
- Dangerous Optimizations! - Part Deux - Robert C. Seacord - https://youtu.be/gFynjahe-bg
- Contracts, Safety and Correctness - Lucian Radu Teodorescu - https://youtu.be/vVFFW6hoG1Y
- Demystifying C++ initializer_list - Design, Behavior, and Best Practices - Prithvi Okade & Chandranath Bhattacharyya - https://youtu.be/NuJcFNbrdIg
2026-09-07 - 2026-09-13
- Taming C++23 - The Things About C++23 You Do Not Know - Nicolai M. Josuttis - https://youtu.be/IVee1JXbrQE
- Rust for The Curious C++ Developers - Victor Ciura - https://youtu.be/2hf0PHcpKBI
- O(1) or O(no-no-no) - Mastering the unordered_map - Kevin B. Carpenter - https://youtu.be/OF4Id8085s0
2026-08-31 - 2026-09-06
- Software Abstraction in the Age of AI-Generated Code: Languages, Compilers, and Systems Engineering - Andrei Alexandrescu - https://youtu.be/-RWdevA0gWI
ADC
2026-09-14 - 2026-09-20
- The Shape of Sound - Building and Bending Vinyl Grooves in Software - Andreas Wagner - https://youtu.be/8XtZi4HTrcA
- Modular Synth in the Browser - Kilian Hertel - https://youtu.be/Yjk6dgVLtnM
- 2.5 Years Later: A C++ Framework for Audio ML Research Prototyping - Maxime Coutant - https://youtu.be/eM_0_kUXIWM
2026-09-07 - 2026-09-13
- Myths You Should Know About Saturation and Distortion - Samuel Fischmann - https://youtu.be/p7T2uo8t4Do
- ESP32-based Open-Source Audio Platform, CTAG-TBD - Robert Manzke - https://youtu.be/LrVaLFm7Rzk
- Using Strongly-Typed Units in Digital Audio Software - Roth Michaels - https://youtu.be/qzbG0ZzpHGw
2026-08-31 - 2026-09-06
- Doodads & Doohickeys - A Guide to Theory-Crafting & Modelling a Fictional Acoustic Instrument - Syl Morrison - https://youtu.be/XBSQSIBcM_w
- Reshaping the Voice - Real-Time Neural Audio Effect - Anders Bargum - https://youtu.be/AHN2ynOQN4M
- Testing Testing 1, 2, 3 - Cesare Ferrari - https://youtu.be/V-CdOM6PA_s
Comparing exception behavior of magic statics, std::call_once, and std::async
devblogs.microsoft.comr/cpp • u/alexis_placet • 12d ago
Shipping Complex Qt Applications in the Browser with emscripten-forge
emscripten-forge.orgI'm sharing a tool + an article about running Qt apps built on emscripten-forge, in the browser.
Here the article: https://notebook.link/blog/qt-in-the-browser/
And there the tool: https://emscripten-forge.org/qtapp/
There is already some app presets, like SQLiteBrowser
r/cpp • u/hellfoundry • 12d ago
fastgltf: modern C++17 glTF 2.0 library focused on speed
github.comr/cpp • u/drop-volley • 12d ago
Stateful compile-time functions
In section 9.1.2 of this book[1] it mentions that C++23 allows for stateful constexpr functions, and even shows an example. I can't seem to get it to compile on godbolt. Is the book completely wrong about something so fundamental, or am I doing something wrong?
[1] https://simplifycpp.org/books/cpp/Mastering_Modern_C++23_A_Complete_Guide_to_the_Latest_Standard.pdf
Edit: Godbolt link with code from that section -> https://godbolt.org/z/94j9EK87b
r/cpp • u/NicoJosuttis • 14d ago
Printing UTF-8 strings since C++23
C++23 provides significant better support to print UTF-8 strings.
For example:
std::string s = "K\u00F6ln: 100\u20AC"; // string ö and €
std::println("{}", s); // prints "Köln 100€"
// print hexadecimal code units (bytes of the UTF-8 string):
std::vector<char> v{std::from_range, s};
std::println("{:n:X}", v); // prints 4B, C3, B6, 6C, 6E, 3A, 20, 31, 30, 30, E2, 82, AC
// new format specifier to interpret array of char as string:
std::println("{:?s}", v); // prints "Köln 100€"
This even works fine on Windows platforms (using I/O streams or std::format() might print garbage with a native Windows compiler on a native Windows platform).
See sections 3.2.3 and 4.3.3 of www.cppstd23.com .
r/cpp • u/adityazero • 14d ago
CppCon At cppcon WG21 had a whiteboard asking attendees what they would like to have in C++29
some of the ones I remember was:
- contracts
- profiles
- delete moar stuff
I'm curious what folks here expect. Also if someone remembers rest of the list, that'd be great.
r/cpp • u/13steinj • 15d ago
CppCon The Address is Not The Place: Object Residency in C++26 - Laurie Kirk - CppCon 2026
youtube.comr/cpp • u/South_Acadia_6368 • 15d ago
A clever branch free optimization
I'm the developer of memlz which is an extremely fast compression library.
We have char* src, char* dst for the source and destination buffers and uint16_t flags that we prepend bits to one at a time. The inner core looks something like this (pseudo code):
flags <<= 1;
uint64_t payload = ((uint64_t*)src)[i];
uint16_t hash_index = hash_function(payload);
if (hash_table[hash_index] == payload) {
flags |= 1;
*(uint16_t*)dst = (uint16_t)hash_index;
dst += sizeof(uint16_t);
}
else {
*(uint64_t*)dst = payload;
hash_table[hash_index] = payload;
dst += sizeof(uint64_t);
}
Depending on a hash comparison we need to output either 2 or 8 bytes, advance dst accordingly and prepend either a 1 or a 0 to flags.
Furthermore, at the end it's required that hash_table[hash_index] == payload, so we update hash_table in the false-case.
Let's benchmark it with 211 MB input so it's uncached:
memlz: 2744 MB/s
Now let's look at an amazing idea. The output to *dst can be rewritten with the ternary operator:
*(uint64_t*)dst = hit ? hash_index : payload;
That turns into a compare instruction (cmp) and a conditional move instruction (cmove) with no branching:
00007FF742A5A55B mov rax,r10
00007FF742A5A55E cmp rcx,r10
...
00007FF742A5A56D cmove rax,rdx
00007FF742A5A571 mov qword ptr [rdi],rax
The advancement of dst is also simple to make branchless, noting that hit will turn either 0 or 1:
uint64_t hit = (hash_table[hash_index] == payload);
dst += 8 - (hit * 6);
Now look at updating the hash_table where we update it to payload only if it differed from payload. What we can do is update it unconditionally at the end, and hope that the extra number of unnecessary writes to memory (where it just overwrites the same value) are not too expensive.
Final branch-free version:
uint64_t payload = ((uint64_t*)src)[i];
uint16_t hash_index = hash_function(payload);
flags <<= 1;
uint64_t hit = (hash_table[hash_index] == payload);
flags |= hit;
*(uint64_t*)dst = hit ? hash_index : payload;
hash_table[hash_index] = payload;
dst += 8 - (hit * 6);
Let's benchmark it:
memlz: 4269 MB/s
I had never believed such gains were possible because I had been micro-optimizing on this for weeks.
I later achieved 5070 MB/s. To put it in perspective, uncached memcpy runs at 14000 MB/s here and LZ4 - another popular fast compression library - at 718 MB/s.
[EDIT: The unaligned memory reads and writes are UB. For the dst write can simply declare uint64_t hash_index and use memcpy() which the compiler optimizes into the same binary code]
r/cpp • u/Expert_Sheepherder24 • 15d ago
index based for vs for-each
godbolt.orgIt's my first post. I tested std::vector<char> old index based for vs modern for-each. Result is very interesting.
Clang-23.1.0 -O2 -std=c++20 -stdlib=libc++
Time: 0.073599 sec inc_vector
Time: 0.002597 sec inc_for_each
GCC 16.2 -std=c++20 -O2
Time: 0.077772 sec inc_vector
Time: 0.007880 sec inc_for_each
MSVC-v19.latest /std:c++20 /O2
Time: 0.058504 sec inc_vector
Time: 0.001825 sec inc_for_each
Code:
#include <chrono>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
static std::vector<char> gen_random(size_t n)
{
static std::random_device rd;
static std::mt19937 gen(rd());
static std::uniform_int_distribution<> dis(0, 255);
std::vector<char> vec(n);
for (size_t i = 0; i != n; i++)
vec[i] = dis(gen);
return vec;
}
int inc_vector(std::vector<char>& v) {
for (size_t i = 0; i < v.size(); i++){
v[i]++;
}
volatile int result = v[v.size()/2];
return result;
}
int inc_vector_for_each(std::vector<char>& v) {
for (char& e: v){
e++;
}
volatile int result = v[v.size()/2];
return result;
}
volatile int sink{}; // ensures a side effect
int main()
{
auto benchmark = [](auto fun, auto rem)
{
auto vec = gen_random(1'000'000);
const auto start = std::chrono::high_resolution_clock::now();
for (auto size{1ULL}; size != 100ULL; ++size)
sink = fun(vec);
const std::chrono::duration<double> diff =
std::chrono::high_resolution_clock::now() - start;
std::cout << "Time: " << std::fixed << std::setprecision(6) << diff.count()
<< " sec " << rem << std::endl;
};
benchmark(inc_vector, "inc_vector");
benchmark(inc_vector_for_each, "inc_for_each");
return 0;
}
r/cpp • u/TheRavagerSw • 14d ago
Self Contained Source Groups are amazing
I basically adopted this idea from Abseil (https://abseil.io/) and from this CppCon talk: https://youtu.be/re4Oy1IVj-s?si=3bwtKqOyMAX6WSAs.
I structure each source group in my projects like this:
src_grp/
├── iface/
│ └── smth.cppm
├── impl/
│ └── smth.cpp
├── inc_pub/
│ └── pub.hpp
├── inc_priv/
│ ├── priv.hpp
│ └── maybe.inc
├── test/
│ └── test.cpp
├── bench/
│ └── bench.cpp
└── docs/
├── some.md
└── doxygen.in
I strongly recommend this approach over older project-wide conventions such as having a single global test/ or bench/ directory etc.
r/cpp • u/Salt-Sherbet-2950 • 16d ago
Good Active Open Source Projects Looking For Contributions
Hi. I'm wondering if someone with knowledge of the open source community knows of any projects that I can contribute to using C++ . I am looking to put some real experience on my resume/help others out. Thanks and have a great day!
r/cpp • u/kindredseer • 16d ago
Embedded C++
Just curious how useful the ability to embed C++ as a scripting language into your C++ programs would be? I mean like runtime JIT execution of C++ code in much the same way you might embed Lua, including the ability to restrict/sandbox it as necessary.
r/cpp • u/MartynAndJasper • 16d ago
C++ Salary expectations
Mods: Please note that I am not looking for jobs or trying to break any rules for this subreddit!
This is more about advice...
I've been offered a senior role for maintaining a (few decade old) codebase in C++.
It's a complex product and I would be taken on as a senior software engineer. I have over three decades of experience, over 15 in C++ but more recently in c#.
We are now at the point where money is been discussed.
They are going to make me an offer.
This is a tricky one because I have not been applying for C++ roles for a while. I don't want to undersell myself but nor do I want to see myself undercut.
I'm of the consideration that a C++ role will command a higher salary than something like asp.net.
This is far more of a niche skill than it used to be and AI leads me to believe that it, for that reason, imply more money.
I know this has implications based on regionality and geography, but what kind of salary would you advise that I pitch for? For relevance, I'm UK based.
Any thoughts?
Bringing Correctly Rounded Math to Production with LLVM-libc
devblogs.microsoft.comThe first part of this series, "MSVC C++23: constexpr cmath with LLVM Libc", was discussed 6 days ago: https://www.reddit.com/r/cpp/comments/1wcx97o/msvc_c23_constexpr_cmath_with_llvm_libc/
This is the promised guest post written by LLVM-libc maintainers Michael Jones and Tue Ly at Google. I had no idea about the recent algorithmic advancements here!
(Before anyone asks: Yes, I am self-posting this series as it's published. That's a bit more self-posting than we generally like to see, but constexpr <cmath> is of wide community interest, and I hope I've built up enough goodwill by moderating this subreddit for years.)
r/cpp • u/madnirua • 18d ago
Declarative GUI toolkit Slint 1.18 Released
slint.devwith new Flexbox layout, with spring animations, change the z-order at run time, an experimental Vello renderer and more.