r/cpp 28d ago

C++ Show and Tell - August 2026

49 Upvotes

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/1umnaxs/c_show_and_tell_july_2026/


r/cpp Jul 04 '26

C++ Jobs - Q3 2026

61 Upvotes

Rules For Individuals

  • Don't create top-level comments - those are for employers.
  • Feel free to reply to top-level comments with on-topic questions.
  • I will create top-level comments for meta discussion and individuals looking for work.

Rules For Employers

  • If you're hiring directly, you're fine, skip this bullet point. If you're a third-party recruiter, see the extra rules below.
  • Multiple top-level comments per employer are now permitted.
    • It's still fine to consolidate multiple job openings into a single comment, or mention them in replies to your own top-level comment.
  • Don't use URL shorteners.
    • reddiquette forbids them because they're opaque to the spam filter.
  • Use the following template.
    • Use **two stars** to bold text. Use empty lines to separate sections.
  • Proofread your comment after posting it, and edit any formatting mistakes.

Template

**Company:** [Company name; also, use the "formatting help" to make it a link to your company's website, or a specific careers page if you have one.]

**Type:** [Full time, part time, internship, contract, etc.]

**Compensation:** [This section is optional, and you can omit it without explaining why. However, including it will help your job posting stand out as there is extreme demand from candidates looking for this info. If you choose to provide this section, it must contain (a range of) actual numbers - don't waste anyone's time by saying "Compensation: Competitive."]

**Location:** [Where's your office - or if you're hiring at multiple offices, list them. If your workplace language isn't English, please specify it. It's suggested, but not required, to include the country/region; "Redmond, WA, USA" is clearer for international candidates.]

**Remote:** [Do you offer the option of working remotely? If so, do you require employees to live in certain areas or time zones?]

**Visa Sponsorship:** [Does your company sponsor visas?]

**Description:** [What does your company do, and what are you hiring C++ devs for? How much experience are you looking for, and what seniority levels are you hiring for? The more details you provide, the better.]

**Technologies:** [Required: what version of the C++ Standard do you mainly use? Optional: do you use Linux/Mac/Windows, are there languages you use in addition to C++, are there technologies like OpenGL or libraries like Boost that you need/want/like experience with, etc.]

**Contact:** [How do you want to be contacted? Email, reddit PM, telepathy, gravitational waves?]

Extra Rules For Third-Party Recruiters

Send modmail to request pre-approval on a case-by-case basis. We'll want to hear what info you can provide (in this case you can withhold client company names, and compensation info is still recommended but optional). We hope that you can connect candidates with jobs that would otherwise be unavailable, and we expect you to treat candidates well.

Previous Post


r/cpp 6h ago

Optimizing a Spin-Lock

Thumbnail david.alvarezrosa.com
32 Upvotes

r/cpp 5h ago

Partial application of class templates

Thumbnail elbeno.com
6 Upvotes

r/cpp 5h ago

Lazy Evaluation

Thumbnail breese.github.io
3 Upvotes

r/cpp 8h ago

Ordering of qualifiers

3 Upvotes

I know this is something that pops up quite often, but I was wondering if I could get your guys' opinion on a fixed ordering of qualifiers. This is my current thoughts after recently trying to formalize my personal style:

static -> thread_local -> inline -> constexpr -> friend -> virtual

My reasoning for each:

  1. static first. Inside a class, its basically javas static. There is a pretty strong consensus in java for static first. Its very important context, for both functions and variables. Outside of classes, its more of a linkage specifier, which is arguably more important/nasty if you mess it up. The fact that it has this dual behaviour in C++ in my opinion makes an even stronger argument for including it first, your brain is able to parse it first thing. i.e okay this is static, we are in a class? -> its java static, we are in global scope -> its static linkage.
  2. thread_local directly after static, and then inline, then constexpr/consteval. This way, qualifiers which impact storage and or linkage are stuck together. I personally like to write inline even for constexpr/consteval functions, as its sometimes easy to forget the implicit inline. I used to do this for member functions with definitions in the class, but I feel the implicit inline there is a bit more well known/easier to intuit.
  3. The rest I'm far less opinionated on, since I barely ever use inheritance or the friend keyword. . I could go both ways on virtual/friend, so i default to alphabetical/aesthetics.

What do you guys think? I know this is pedantic and a very well explored topic but I wanted to know if you guys had any particular wisdom to sway me either way, mainly on the ordering of the first few.


r/cpp 1d ago

C++26: std::hive

Thumbnail sandordargo.com
62 Upvotes

r/cpp 1h ago

I built Uranium: A statically typed language with a hand-rolled x86_64 JIT (no LLVM) and generational GC in modern C++

Upvotes

Hey everyone,

I wanted to share some architecture insights from a large hobby project I have been developing in modern C++ (C++17/20): an execution environment and compiler runtime called Uranium.

Rather than wiring up heavy third-party backends like LLVM, the goal was to build the entire systems layer directly in C++ to understand execution mechanics at the hardware level.

Key C++ architecture details:

  1. JIT without external libraries (src/native_jit_x64.cpp): Implemented a lightweight assembler in C++ that allocates executable pages (VirtualAlloc on Windows, mprotect on POSIX) and emits raw x86_64 opcodes directly for hot numeric loops and branch patching. It detects hot execution paths via loop back-edge tracking in the interpreter dispatch loop.

  2. Generational GC and Memory Management (src/heap.cpp): Instead of generic smart pointers or standard allocators, memory is managed through an anti-fragmentation object pool using placement new. It features a two-tier generational Mark & Sweep (young nursery vs full sweep) guarded by pointer write barriers (writeBarrier) to maintain remembered sets.

  3. Concurrency & Native Subsystems: Built a cooperative async task scheduler, custom socket abstraction for raw TCP, and embedded SQLite3, all unified within the C++ runtime.

Repository: https://github.com/bruhgit/Uranium-Programming-Language

I would love to get feedback on the modern C++ idioms, memory layout, or any potential architectural bottlenecks from fellow C++ systems developers!


r/cpp 1d ago

Make APIs that fail gracefully rather that fallback silently · Mathieu Ropert

Thumbnail mropert.github.io
53 Upvotes

r/cpp 2d ago

CppCon CppCon 2026 Keynote: C++: Profiles for Simplicity and Guarantees -- Bjarne Stroustrup

Thumbnail isocpp.org
83 Upvotes

r/cpp 3d ago

Two Tricks to Use the std Module Implicitly, with 20% compilation time improvements on Seastar without touching the source

Thumbnail chuanqixu9.github.io
50 Upvotes

r/cpp 3d ago

New C++ Conference Videos Released This Month - August 2026 (Updated To Include Videos Released 2026-08-24 - 2026-08-30)

27 Upvotes

C++Now

2026-08-24 - 2026-08-30

2026-08-17 - 2026-08-23

2026-08-10 - 2026-08-16

2026-08-03 - 2026-08-09

2026-07-27 - 2026-08-02

C++Online

2026-08-24 - 2026-08-30

2026-08-17 - 2026-08-23

2026-08-10 - 2026-08-16

2026-08-03 - 2026-08-09

2026-07-27 - 2026-08-02

ADC

2026-08-24 - 2026-08-30

2026-08-17 - 2026-08-23

2026-08-10 - 2026-08-16

2026-08-03 - 2026-08-09

2026-07-27 - 2026-08-02


r/cpp 4d ago

StockholmCpp 0x3F: Intro, Info and The Quiz!

Thumbnail youtu.be
6 Upvotes

The intro from August's StockholmCpp Meetup: news about C++ in Sweden from the NB and the community, some words from our event sponsor, and, of course, a quiz!


r/cpp 5d ago

On forcing all derived classes to implement a specific non-virtual method, part 2

Thumbnail devblogs.microsoft.com
66 Upvotes

r/cpp 6d ago

Might have found a (tiny, nuisance) bug in g++ 16.2.1 and -Wconversion?

27 Upvotes

I am far from presuming myself a compiler expert, and no this was not AI, I promise. I'm simply a long-time user of gcc/g++, and it's not everyday I am confident enough that a bug is not in my code but with the tool, haha. I'm pretty warning-sensitive so this kind of thing catches my attention. Wondering if I'm missing something, so asking it here first.

g++ version: g++ (GCC) 16.2.1 20260819 (Red Hat 16.2.1-2) (I'm on Fedora 44)
C++20

Given lines like this:

cpp std::uint16_t count = 0; // int other_var set elsewhere count += (other_var == 5); // <-- -Wconversion flags this

specifically, the warning is:

bash <file>:<line>:<col>: warning: conversion from ‘int’ to ‘uint16_t’ {aka ‘short unsigned int’} may change value [-Wconversion] <line> | count += (other_var == 5);

-Wconversion /w either -O0 and -O3 (my usual build optimization lvls to catch optimization-dependent warnings), this gets flagged.

Well, the result of a boolean expression is 0 or 1, so obviously, there should not be a conversion. Even with the accumulate op here and integer promotion, there shouldn't be a warning (you can do count += 1 or count++ and it definitely doesn't flag -Wconversion). And more notably, the below code doesn't get flagged:

cpp std::uint16_t count = 0; // int other_var set elsewhere bool match = (other_var == 5); count += match;

I also noted that clang with -Wconversion and the same optimization lvls does not flag this. I also know I've done this before in C with other versions of gcc and don't get flagged with this.

So, am I missing something or am I right to suspect this is a possible bug with at least my version of g++?


r/cpp 5d ago

The weirdest behavior in C++ that came from C

0 Upvotes

If you're trying to define two pointers in a single statement (what is in general a bad idea), you may want to do it like this:

#include <print>

int main()
{
    int x = 10;
    int* a, b;
    a = &x;
    b = &x;
    std::println("a={:#x}, b={:#x}", uintptr_t(a), uintptr_t(b));
}

However, it doesn't work as you expect, and won't compile. Because int* a, b; declares only a as int*; b, and all the rest variables will be int. The correct one-statement declaration of two pointers is int* a, * b;

main.cpp:8:9: error: invalid conversion from ‘int*’ to ‘int’ [-fpermissive]
    8 |     b = &x;
      |         ^~
      |         |
      |         int*

b has type int

This behavior is the reason why some people prefer putting the asterisk next to the variable name, not next to the type

I can understand the logic, that C authors had while making this syntax. It's a sort of reversive/deduction logic. You kinda declare what type it will be after using the dereference * operator, instead of declaring the type being a pointer itself. But I find this logic very-very strange, and overthought

The funny thing, that even the compiler in the error message above, treats * as a sort of type modifier, that is inseparable from int. But, apparently, the C creators had a completely different vision on what pointers are

I personally don't think that this behavior justifies reteaching yourself to write * in front of variable names, and especially in front of function names. I think it's just a not well-thought decision made very long ago in 1970s


r/cpp 7d ago

C++ bugs in the most popular PS4 emulator

Thumbnail pvs-studio.com
99 Upvotes

r/cpp 8d ago

Clang 23 Release Notes

Thumbnail releases.llvm.org
107 Upvotes

r/cpp 8d ago

C++26: std::inplace_vector

Thumbnail sandordargo.com
179 Upvotes

r/cpp 8d ago

mold: A Massively Parallel Linker

Thumbnail arxiv.org
180 Upvotes

r/cpp 8d ago

Au (units) 0.6.0 out: blockbuster release!

Thumbnail github.com
44 Upvotes

It's been just over a year since our last significant release, and this one ended up big... honestly, maybe a bit over-stuffed. 😅 We did tackle both of the biggest requests from the last post: we no longer swallow compiler errors (see our new compiler warnings philosophy doc for more details), and we have worked examples. Besides these, some of the remaining highlights are:

  • Full vector and matrix support: everything except mixed-units in a single vector/matrix
  • First-class Eigen support --- the first units library to preserve Eigen's full performance in all cases
  • CUDA (and HIP) are now supported out of the box
  • More powerful/flexible user-defined literals compared to other libraries (see this fascinating Abbreviated Quantity Construction discussion doc for the nuances here)
  • More ergonomic integer division: divide_using_common_unit(a, b) is almost always what you want for same-dimension inputs
  • Constant and Magnitude now get arithmetic and comparison operators whenever the results are computable, making them much more ergonomic

We also refreshed our C++ units library comparison page. It's awesome to see all the progress on the other leading libraries, as well as ours!

We hope you find the new release useful and fun, and we're excited to hear any feedback you may have!


r/cpp 8d ago

Data members that want to use `size()` – Arthur O'Dwyer

Thumbnail quuxplusone.github.io
38 Upvotes

r/cpp 9d ago

Why is `import std` still experimental ???

121 Upvotes

Hey guys,

I recently started going through Professional C++ (6th Edition). The book teaches C++23, and in the very first chapter we're introduced to modules.

I'm not a complete newbie to C++, but I'm also definitely not very confident in my knowledge yet. I wanted to get this simple example compiled:

import std;

int main() {
    std::println("Hello World");
    return 0;
}

And gosh, it took way longer than I expected.

First, I tried getting it to work natively on my Mac and eventually gave up (both Claude and I 😅).

Then I installed Ubuntu ARM 26 and finally managed to get it compiling. But now Clang/IntelliSense is complaining about the `import std`
This is what my CMakeLists.txt currently looks like:

cmake_minimum_required(VERSION 4.0)

# set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD ON)

set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "d0edc3af-4c50-42ea-a356-e2862fe7a444")

project(CppProject LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 26)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

add_executable(exec main.cpp)

set_property(TARGET exec PROPERTY CXX_MODULE_STD ON)

The code does compile successfully, but CMake still gives me a warning that import std support is experimental.

So I'm genuinely curious:

Why is import std still considered experimental?

I understand that C++ modules themselves have been around for a while, but import std feels like something that should be much more straightforward by now. Is there any solution of this now ?

--------------
Edit

Thanks to u/PhysicsOk2212 tip I was able to compile my project on mac as well using the following options
```
cmake -S . -B build \

-G Ninja \

-DCMAKE_CXX_COMPILER="$(brew --prefix llvm)/bin/clang++" \

-DCMAKE_CXX_STDLIB_MODULES_JSON="$(brew --prefix llvm)/lib/c++/libc++.modules.json"

```


r/cpp 9d ago

Latest News From Upcoming C++ Conferences (2026-08-25)

7 Upvotes

TICKETS AVAILABLE TO PURCHASE

The following conferences currently have tickets available to purchase

OPEN CALL FOR SPEAKERS

There are currently no open call for speakers

OTHER OPEN CALLS

TRAINING COURSES AVAILABLE FOR PURCHASE

Conferences are offering the following training courses:

CppCon Online Workshops

9th – 11th September

  1. Modern C++: When Efficiency Matters – Andreas Fertig – 3 day online workshop available on 9th – 11th September 09.00 – 15.00 MDT – https://cppcon.org/class-2026-when-efficiency-matters/
  2. System Architecture And Design Using Modern C++ – Charley Bay – 3 day online workshop available on 9th – 11th September 09.00 – 15.00 MDT – https://cppcon.org/class-2026-system-architecture-and-design-using-modern-cpp/

21st – 23rd September

  1. C++ Fundamentals You Wish You Had Known Earlier – Mateusz Pusz – 3 day online workshop available on 21st– 23rd September 09.00 – 15.00 MDT – https://cppcon.org/class-2026-cpp-fundamentals/
  2. C++23 in Practice: A Complete Introduction – Nicolai Josuttis – 3 day online workshop available on 21st– 23rd September 09.00 – 15.00 MDT – https://cppcon.org/class-2026-cpp23-in-practice/
  3. Programming with C++20 – Andreas Fertig – 3 day online workshop available on 21st– 23rd September 09.00 – 15.00 MDT – https://cppcon.org/class-2026-programming-with-cpp20/

26th – 27th September

  1. Using C++ for Low-Latency Systems – Patrice Roy – 2 day online workshop available on 26th– 27th September 09.00 – 17.00 MDT – https://cppcon.org/class-2026-low-latency/

CppCon Onsite Workshops

All onsite workshops will take place in the Gaylord Rockies in Aurora, Colorado

12th & 13th September

  1. Advanced and Modern C++ Programming: The Tricky Parts – Nicolai Josuttis – 2 day in-person workshop available on 12th & 13th September – 09:00 – 17:00 – https://cppcon.org/class-2026-tricky-parts/
  2. C++ Best Practices – Jason Turner – 2 day in-person workshop available on 12th & 13th September – 09:00 – 17:00 – https://cppcon.org/class-2026-best-practices/
  3. How Hardware Gets Hacked: Breaking and Defending Embedded Systems – Nathan Jones – 2 day in-person workshop available on 12th & 13th September – 09:00 – 17:00 – https://cppcon.org/class-2026-hardware-hack/
  4. Mastering `std::execution`: A Hands-On Workshop – Mateusz Pusz – 2 day in-person workshop available on 12th & 13th September – 09:00 – 17:00 – https://cppcon.org/class-2026-execution/
  5. Performance and Efficiency in C++ for Experts, Future Experts, and Everyone Else – Fedor Pikus – 2 day in-person workshop available on 12th & 13th September – 09:00 – 17:00 – https://cppcon.org/class-2026-performance-and-efficiency/
  6. Talking Tech – Sherry Sontag – 2 day in-person workshop available on 12th & 13th September – 09:00 – 17:00 – https://cppcon.org/class-2026-talking-tech/

 13th September

  1. AI++ 101 : Build a C++ Coding Agent from Scratch – Jody Hagins – 2 day in-person workshop available on 12th & 13th September – 09:00 – 17:00 – https://cppcon.org/class-2026-AI101/
  2. Essential GDB and Linux System Tools – Mike Shah – 1 day in-person workshop available on 13th September – 09:00 – 17:00 – https://cppcon.org/class-2026-essential-gdb/

19th & 20th September

  1. AI++ 201: Building High Quality C++ Infrastructure with AI – Jody Hagins – 2 day in-person workshop available on 19th & 20th September – 09:00 – 17:00 – https://cppcon.org/class-2026-ai201/
  2. Function and Class Design with C++2x – Jeff Garland – 2 day in-person workshop available on 19th & 20th September – 09:00 – 17:00 – https://cppcon.org/class-2026-function-class-design/
  3. High-performance Concurrency in C++ – Fedor Pikus – 2 day in-person workshop available on 19th & 20th September – 09:00 – 17:00 – https://cppcon.org/class-2026-high-perf-concurrency/

OTHER NEWS

Finally anyone who is coming to a conference in the UK such as C++ on Sea or ADC from overseas may now be required to obtain Visas to attend. Find out more including how to get a VISA at https://homeofficemedia.blog.gov.uk/electronic-travel-authorisation-eta-factsheet-january-2025/


r/cpp 8d ago

Libraries trying to support multiple build configurations and standards are harming their health

0 Upvotes

Some libraries try to support:

  • Header/Source
  • Header only
  • Header only + Module Wrapper
  • Header/Source + Module Wrapper
  • All standards between and including C++11 and C++23
  • Exceptions and noException
  • RTTI and noRTTI

At the same time.

These libraries are very very hard to read and thus they get less and less contributions over time.

What should be done:

  • Libraries should support only one mode of compilation, header only header source etc
  • Libraries should support exactly one standard, and that standard includes extensions, gnu++23 and c++23 are not the same thing
  • Libraries should very clearly have boundaries on what belong in a toolchain and what belongs to project. For example a library should not set flags related to exceptions that's a toolchain issue.

Some extra stuff:

  • C++ libraries without C API's should not be consumed via system package managers at all, and public libraries shouldn't try to adhere to that.
  • Libraries shouldn't try to use tools they build to build themselves, rather they should export packages like wayland::scanner etc and use that.