C++ Show and Tell - December 2026
Use this thread to share anything you've written in C++. This includes:
* a tool you've written
* a game you've been working on
* your first non-trivial C++ program
The rules of this thread are very straight forward:
* The project must involve C++ in some way.
* It must be something you (alone or with others) have done.
* Please share a link, if applicable.
* Please post images, if applicable.
If you're working on a C++ library, you can also share new releases or major updates in a dedicated post as before. The line we're drawing is between "written in C++" and "useful for C++ programmers specifically". If you're writing a C++ library or tool for C++ developers, that's something C++ programmers can use and is on-topic for a main submission. It's different if you're just using C++ to implement a generic program that isn't specifically about C++: you're free to share it here, but it wouldn't quite fit as a standalone post.
Last month's thread: https://www.reddit.com/r/cpp/comments/1xo0gru/c_show_and_tell_november_2026/
https://redd.it/1ya8fj4
@r_cpp
Use this thread to share anything you've written in C++. This includes:
* a tool you've written
* a game you've been working on
* your first non-trivial C++ program
The rules of this thread are very straight forward:
* The project must involve C++ in some way.
* It must be something you (alone or with others) have done.
* Please share a link, if applicable.
* Please post images, if applicable.
If you're working on a C++ library, you can also share new releases or major updates in a dedicated post as before. The line we're drawing is between "written in C++" and "useful for C++ programmers specifically". If you're writing a C++ library or tool for C++ developers, that's something C++ programmers can use and is on-topic for a main submission. It's different if you're just using C++ to implement a generic program that isn't specifically about C++: you're free to share it here, but it wouldn't quite fit as a standalone post.
Last month's thread: https://www.reddit.com/r/cpp/comments/1xo0gru/c_show_and_tell_november_2026/
https://redd.it/1ya8fj4
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
Visual Studio/MSBuild should have a way to easily consume modules and/or CPS from external libraries
https://developercommunity.visualstudio.com/t/Visual-StudioMSBuild-should-have-a-way/11188994
https://redd.it/1ya5vuw
@r_cpp
https://developercommunity.visualstudio.com/t/Visual-StudioMSBuild-should-have-a-way/11188994
https://redd.it/1ya5vuw
@r_cpp
Visualstudio
Visual Studio/MSBuild should have a way to easily consume modules and/or CPS from external libraries
What is the intended way to consume the modules of an external library? I'm not sure. With header-based libs, you just add to the include and lib path...
Less Code Doesn't Mean Faster Code
Take, for example, a simple reduction: summing all the elements in an array...
template<typename T>
T vectorreducesimple(T src, size_t len, T initial)
{
for(size_t i = 0; i < len; i++)
{
initial += src[i];
}
return initial;
}
Or this version:
template<typename T>
T vector_reduce_cpu(const T src, sizet len, T initial /* = 0 */)
{
while( len >= 4 ) {
T r00, r01, r02, r03 ;
r00 = src[0] ;
r01 = src[1] ;
r02 = src[2] ;
r03 = src[3] ;
r00 += r02 ;
r01 += r03 ;
r00 += r01 ;
initial += r00 ;
len -= 4 ;
src += 4 ;
} // while
while( len >= 2 ) {
T r00, r01 ;
r00 = src[0] ;
r01 = src[1] ;
r00 += r01 ;
initial += r00 ;
len -= 2 ;
src += 2 ;
} // while
while( len >= 1 ) {
T r00 ;
r00 = src[0] ;
initial += r00 ;
len -= 1 ;
src += 1 ;
} // while
return initial ;
}
On an i9 CPU, with T being 'double', in optimal cases (i.e., a length of about 2000-7000), the longer version runs 4x faster when compiled with gcc and -O3. Why?
Even going back to the 1980s, with the [68882](https://en.wikipedia.org/wiki/Motorola68881) FPU, floating-point units could perform operations in parallel. In the shorter case, that parallelism is defeated by the accumulation occurring solely through the 'initial' variable.
By introducing more variables, the additions can occur in parallel. The compiler also optimizes memory by interleaving variable loads with additions, which can also run in parallel.
So what's the takeaway?
Just turning on -O3 isn't enough
It pays to be aware of the hardware you're going to run on
The deep dive: https://github.com/AndrewOfC/vector\_reduction
https://redd.it/1yac9ay
@r_cpp
Take, for example, a simple reduction: summing all the elements in an array...
template<typename T>
T vectorreducesimple(T src, size_t len, T initial)
{
for(size_t i = 0; i < len; i++)
{
initial += src[i];
}
return initial;
}
Or this version:
template<typename T>
T vector_reduce_cpu(const T src, sizet len, T initial /* = 0 */)
{
while( len >= 4 ) {
T r00, r01, r02, r03 ;
r00 = src[0] ;
r01 = src[1] ;
r02 = src[2] ;
r03 = src[3] ;
r00 += r02 ;
r01 += r03 ;
r00 += r01 ;
initial += r00 ;
len -= 4 ;
src += 4 ;
} // while
while( len >= 2 ) {
T r00, r01 ;
r00 = src[0] ;
r01 = src[1] ;
r00 += r01 ;
initial += r00 ;
len -= 2 ;
src += 2 ;
} // while
while( len >= 1 ) {
T r00 ;
r00 = src[0] ;
initial += r00 ;
len -= 1 ;
src += 1 ;
} // while
return initial ;
}
On an i9 CPU, with T being 'double', in optimal cases (i.e., a length of about 2000-7000), the longer version runs 4x faster when compiled with gcc and -O3. Why?
Even going back to the 1980s, with the [68882](https://en.wikipedia.org/wiki/Motorola68881) FPU, floating-point units could perform operations in parallel. In the shorter case, that parallelism is defeated by the accumulation occurring solely through the 'initial' variable.
By introducing more variables, the additions can occur in parallel. The compiler also optimizes memory by interleaving variable loads with additions, which can also run in parallel.
So what's the takeaway?
Just turning on -O3 isn't enough
It pays to be aware of the hardware you're going to run on
The deep dive: https://github.com/AndrewOfC/vector\_reduction
https://redd.it/1yac9ay
@r_cpp
Local models for C++: Qwen3.8-27B FP8 vs QFN IQ4_XS
https://www.reddit.com/r/Qwen_AI/comments/1yad85f/local_models_for_c_qwen3827b_fp8_vs_qfn_iq4_xs/
https://redd.it/1yadaji
@r_cpp
https://www.reddit.com/r/Qwen_AI/comments/1yad85f/local_models_for_c_qwen3827b_fp8_vs_qfn_iq4_xs/
https://redd.it/1yadaji
@r_cpp
Reddit
From the Qwen_AI community on Reddit: Local models for C++: Qwen3.8-27B FP8 vs QFN IQ4_XS
Explore this post and more from the Qwen_AI community
I don’t even hate AI, I just feel a little sad about being obsolete
I felt cool and smart that I understand low level programming, pointers and memory management and all that stuff. I still program for fun as a hobby but if I start thinking about this stuff I lose my momentum. I like to write my code like an engineer and I am very specific about how I write it. I think AI has good uses for the future but it just makes me sad to think about how anyone can AI generate code and it makes my deep understanding not as cool anymore. My projects matter less, anyone could just instantly generate the code for the game I spent years on. I’m not special anymore nor are my projects. It’s just a little sad. I think about C++26 and C++29, is anyone even going to care about these things anymore with the obsolescence of people who use these features by hand… idk. I get in ruts like this someone and I just have to ignore it. I want to hear everyone else’s opinions especially ones who are very opinionated about programming features and care about their code very much like I do.
Sometimes though I think about ways I program that an AI wouldn’t do, such as my excessive and opinionated use of unsigned integers with explicit cstdint types and the lowest possible bit amount for the variable, while AI will just use standard int. Another one is how I try to avoid dynamic allocations whenever possible, even for silly things like microoptimiaztions, for file paths I’ll do a 4096 stack buffer over dynamic allocation. Makes me feel like I have somewhat of a voice.
https://redd.it/1yajs5y
@r_cpp
I felt cool and smart that I understand low level programming, pointers and memory management and all that stuff. I still program for fun as a hobby but if I start thinking about this stuff I lose my momentum. I like to write my code like an engineer and I am very specific about how I write it. I think AI has good uses for the future but it just makes me sad to think about how anyone can AI generate code and it makes my deep understanding not as cool anymore. My projects matter less, anyone could just instantly generate the code for the game I spent years on. I’m not special anymore nor are my projects. It’s just a little sad. I think about C++26 and C++29, is anyone even going to care about these things anymore with the obsolescence of people who use these features by hand… idk. I get in ruts like this someone and I just have to ignore it. I want to hear everyone else’s opinions especially ones who are very opinionated about programming features and care about their code very much like I do.
Sometimes though I think about ways I program that an AI wouldn’t do, such as my excessive and opinionated use of unsigned integers with explicit cstdint types and the lowest possible bit amount for the variable, while AI will just use standard int. Another one is how I try to avoid dynamic allocations whenever possible, even for silly things like microoptimiaztions, for file paths I’ll do a 4096 stack buffer over dynamic allocation. Makes me feel like I have somewhat of a voice.
https://redd.it/1yajs5y
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
Why we shouldn't want a remote package registry, universal package manager or a binary toolchain orchestrator
Hi, as most of you now, we get cargo good cmake bad posts and comments here nearly every week.
I want to write a definitive post to answer these criticisms. In this post I'm going to argue for a decentralized approach instead, and will try to list some cons and pros of this approach.
Cargo is the package manager of the rust language, it stores packages in source form in a remote registry called crates.io, It also sort of acts as a build system, as you invoke it directly, rather than calling the package manager first then the build system. The problem with this approach is that you don’t own sources, you don’t know about licenses. If one of your packages break, trying to fix it is very annoying. Also builds are very slow, since you don’t have local binary cache for packages. Additionally, unlike a sane dependency model as proposed by Titus Winters. Cargo relies on semver. This means your dependency tree will not scale and will be hard to maintain.
Rustup is a toolchain orchestrator tool that downloads compiler, stdlib and various other tools from the internet.
It seems very nice to be able to setup a toolchain in seconds, as opposed to doing that with c++ which takes very long.
The drawback of this approach is the lack of knowledge about dependencies of your tools wnd especially stdlib. You need to know what version of xcode or msvc you app is compiled against.
What to do then?
We need a decentralized solution, organizations should clone their deps from a remote and write package recipes for them, we need some sort of organization to collaborate and several standards to make this easier, such as a binary package format.
Cargo and rustup are currently more closer to web technologies in toolchain departmant than c++, I don’t see why everyone is so obsessed about it. There is a new slop project written on it every minute, and we think that's a good thing. It is not, it made library quality very questionable.
Wrote on my phone so probably a lot of typos.
https://redd.it/1yaj399
@r_cpp
Hi, as most of you now, we get cargo good cmake bad posts and comments here nearly every week.
I want to write a definitive post to answer these criticisms. In this post I'm going to argue for a decentralized approach instead, and will try to list some cons and pros of this approach.
Cargo is the package manager of the rust language, it stores packages in source form in a remote registry called crates.io, It also sort of acts as a build system, as you invoke it directly, rather than calling the package manager first then the build system. The problem with this approach is that you don’t own sources, you don’t know about licenses. If one of your packages break, trying to fix it is very annoying. Also builds are very slow, since you don’t have local binary cache for packages. Additionally, unlike a sane dependency model as proposed by Titus Winters. Cargo relies on semver. This means your dependency tree will not scale and will be hard to maintain.
Rustup is a toolchain orchestrator tool that downloads compiler, stdlib and various other tools from the internet.
It seems very nice to be able to setup a toolchain in seconds, as opposed to doing that with c++ which takes very long.
The drawback of this approach is the lack of knowledge about dependencies of your tools wnd especially stdlib. You need to know what version of xcode or msvc you app is compiled against.
What to do then?
We need a decentralized solution, organizations should clone their deps from a remote and write package recipes for them, we need some sort of organization to collaborate and several standards to make this easier, such as a binary package format.
Cargo and rustup are currently more closer to web technologies in toolchain departmant than c++, I don’t see why everyone is so obsessed about it. There is a new slop project written on it every minute, and we think that's a good thing. It is not, it made library quality very questionable.
Wrote on my phone so probably a lot of typos.
https://redd.it/1yaj399
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
More community member should join this community
I think many of our discussions went unseen by community member very few member are there in the community who are active I think .If there more community members the discussion will come to some result,some point . What is your opinion on it?
https://redd.it/1yaneyi
@r_cpp
I think many of our discussions went unseen by community member very few member are there in the community who are active I think .If there more community members the discussion will come to some result,some point . What is your opinion on it?
https://redd.it/1yaneyi
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community