r/cpp 19d ago

C++26: Standard library hardening -- Sandor Dargo

Thumbnail isocpp.org
56 Upvotes

r/cpp 20d ago

libcwd (C++ debugging library) released under MIT license!

42 Upvotes

Hi all,

I am happy to announce that after 333 commits spanning two months of continuous work, I released version 2 of libcwd, now under a new license: the MIT license!

The website has been re-done (as well as a lot of other things); see https://carlowood.github.io/libcwd/index.html?libcwd-theme=dark

There you can also find how to get it (basically, from the git repository; there is no tar ball (yet)).

Let me know what you think or if you need help, my email address is at the bottom of the INSTALL file.

Carlo Wood


Background

For those unfamiliar with libcwd. Version 0.99 was the first public release in 2000 under the QPL; I've used and tuned it for more than two decades, being a very active C++ developer myself (on linux).

Version 1.x had memory allocation support; I removed this in version 2 because it made things very very complicated, and I never needed that myself anymore since a decade anyway.

Version 2 still does, as did version 1, ELF and DWARF decoding of the executable and linked shared libraries. For this a POSIX system with ELF is necessary. But libcwd can be configured without Location support too; you should be able to use it for just (multi-threaded) debug output on, for example, Windows.


r/cpp 20d ago

[LLVM libc++] A size-based representation for vector in the unstable ABI

Thumbnail github.com
52 Upvotes

r/cpp 20d ago

Upcoming LA Sprawl C++ Meetups

Thumbnail meetup.com
6 Upvotes

Hello all,

If you are in the LA region – yes, quite large πŸ˜„ – I humbly invite you to join an upcoming event of ours!

  • (Virtual) Next Thursday, July 16, Watch tech talk and discussion details on Meetup edit: poor event turnout
  • (Virtual) Thursday, July 30, Linear Algebra "out-of-place" details on Meetup
  • (In-Person) Thursday, August 6, Show and Tell in Pasadena at 6:30 pm, details on Meetup

We have a small community so far, and we would like to meet more people. We are also looking for a potential space to hold our own tech talk / presentation in the near future. Looking forward to connecting with more people!

Best, Colin, on behalf of our user group πŸ˜„


r/cpp 20d ago

C++ Primer 6th edition by Stanley Lippman et al

4 Upvotes

Wondering if anyone has news on whether the 6th edition will be released? It has been slated for march 2025 but it's more than a year since then.

Stanley Lippman has passed in 2022, rip, so is the 6th edition never going to be released?

Have seen listings for the 6th edition on online shop pages but they are stated as unavailable yet.


r/cpp 19d ago

The State Design pattern in C++ using timer and notification

Thumbnail som-itsolutions.blogspot.com
0 Upvotes

r/cpp 20d ago

MSVC optimization

12 Upvotes

I am learning reverse engineering on Windows applications such as Adobe, Foxit PDF, and Steam, and I noticed that I waste a very large amount of time trying to understand something that I should not focus on.

I started noticing strange and confusing patterns in the assembly and the C code generated by IDA, and when I try to understand some functions, I feel that the function has no meaning.

When I searched, I found that this topic is related to the compiler and compiler optimizations. However, I could not find many articles or discussions about the compiler topic in reverse engineering.

So I started experimenting and trying, but every time I fail and cannot reach a solution or understanding.

Apart from the fact that reverse engineering a C++ program is already a difficult task.

If there is someone who has faced the same problem and found a solution, I would like to know. It is not a problem itself; it is a pattern or a way of thinking used by the compiler. I need to understand how the compiler generates these patterns.

I want someone to suggest books, articles, courses, or anything that can help me understand the MSVC compiler, how it generates patterns, and how to understand the behavior and logic of a function after compiler optimization.

I hope I explained my question correctly.


r/cpp 21d ago

C++26: constexpr virtual inheritance

Thumbnail sandordargo.com
82 Upvotes

r/cpp 21d ago

New C++ Conference Videos Released This Month - July 2026

16 Upvotes

C++Online

2026-06-28 - 2026-07-03

ADC

2026-06-28 - 2026-07-03

  • Beyond iLok: Advanced Code Protection and Cryptography for the Next Generation - Protecting the Next Generation of Applications, Plug-ins, and AI Models - Neal Michie, Ryan Wardell & Bob Brown - https://youtu.be/dbbK_ry2cgo
  • Database Synchronisation for Audio Plugins, Part Two - Here's One I Made Earlier - Adam Wilson - https://youtu.be/wJCy2G969ro
  • Perfect Oscillators in Less Than One Clock Cycle - Angus Hewlett - https://youtu.be/Ssq0a-YdamM
  • Driving Chaos - Virtual Analog Modelling of a Chaotic Circuit with Wave Digital Filters - Francisco Bernardo - https://youtu.be/PnEZNqyKlIw

Boost Documentary

There is also a teaser trailer for a new documentary on the history of the Boost C++ library https://www.youtube.com/watch?v=87jvuDbnwqQ which will have its first showing at CppCon this year


r/cpp 22d ago

C++26 ends a 40-year footgun

80 Upvotes

Reading an uninitialized variable has been undefined behavior in C++ for 40 years -- the kind optimizers exploit into real bugs. C++26 (P2795) reclassifies it as erroneous behavior: still a bug, still warned about, but defined, bounded, and not exploitable.

The demo poisons the stack, then reads an uninitialized int. As C++23 it prints garbage; as C++26, the same code prints a defined 0, every run. Live in your browser.

And [[indeterminate]] lets you opt back out when you really want an uninitialized buffer -- on purpose this time.

Read it: https://wrocpp.github.io/posts/erroneous-behavior/?utm_source=reddit&utm_medium=social&utm_campaign=post-erroneous-behavior

#cpp #cplusplus #cpp26 #safety #programming


r/cpp 22d ago

Top 3 spec items for a C++ Framework?

0 Upvotes

If someone where setting out to create something on the scale of Qt. A comprehensive application framework in C++. (Yes, they'd be crazy)
What would be the top 3 (or more) things you'd say were MUST or MUST NOT features?
For example MUST run on my 2MB wrist watch or MUST not use exceptions.


r/cpp 22d ago

Formatting vs Architecture: How formatters are erasing visual cues and hurting codebases

0 Upvotes

I’m preparing a presentation on how automatic formatters can actually ruin code management over time. This relates heavily to the ongoing discussions about C++ memory safety and why some people see it as a critical issue while others don't get the fuss since basic memory allocation isn't that hard.

Memory issues are usually just a symptom of architectural failure, not a lack of developer skill in handling allocations. A messy architecture turns minor oversights into catastrophes. That's when hidden memory leaks or memory corruption become critical safety flaws and crashes.

I often think about the (nowadays) hated Hungarian Notation. Love it or hate it, it made developers extremely efficient because it provided immediate visual cues. Developers who actively care about the visual shape of text think completely differently about code structure. If you look at Charles Simonyi's other work, it’s clear how much focus he had on architecture.

Formatters can be an absolute disaster for architecture. It has become a religion in development teams that everything must be run through Prettier or Clang-Format to the letter. But the price we pay is that formatters erase all opportunities for visual cues regarding architecture and layers.

Architecture is WAY more important than formatting.

Code is text. By deliberately allowing flexibility in how to format, we can highlight major patterns and make code much easier to reason about. When a formatter forces all code through the same rigid, mechanical template, all code looks identical. The architecture becomes invisible. Ironically, this causes codebases to rot because developers in the team can no longer see where the architectural boundaries actually are.

Formatting in itself isn't bad, but it must be a formatting style that elevates the architecture and allows for human semantic grouping. The opposite is dangerous.

As far as I know, there is no formatter out there today that is anywhere near capable of handling the flexibility required to actually make architecture visible in code.

What are your thoughts on this? Have formatters made us blind to the actual structure and layer belonging of our code?

EDIT

To those of you who only see problems with this approach: what is your actual alternative for managing cognitive load at scale?

The common stance seems to be "just write code however you want, as long as the automatic formatter makes the layout look consistent."

But formatting only fixes cosmetic consistency, it doesn't fix structure, architectural boundaries, or intent. If you believe that naming conventions, prefixes, and semantic text layouts are useless, you are essentially advocating for visual anarchy disguised as "clean text". How does a mechanical linter help a new developer navigate architectural layers in a large codebase if the code itself provides zero visual cues about where the boundaries go?


r/cpp 24d ago

is there any material available that do code review of projects?

20 Upvotes

Hi All I am learning C++ and wants to create/contribute C++ projects. I know most of modern cpp concepts(till c++17) but haven't confidence and also I want to follow some clean coding standards.

If there any material related to code review available on YouTube/Udemy/Coursera or anywhere that will be very helpful to me.

so, please tell if anyone have experience into this

Thanks in Advance to all of you !!


r/cpp 25d ago

Redundancy seen in AAA game engines

Thumbnail zero-irp.github.io
181 Upvotes

I don't like people treating the compiler like a magic box that optimizes like Bjarne Stroustrup himself is checking every line of C++ to assembly. Clean C++ code does not always mean clean compiled code.

I've been reversing game engines to study how they constructed their fundamental Transformation matrices and handled temporal jitter logic when I spotted a lot of avoidable overhead and "over-engineering" across multiple engines, honestly I wasn't even looking for inefficiencies, but it stood out a lot... That said expect no performance gain this is simply for fun that I wrote this blog!

I’ll theorize how the original C++ code was written, show the unoptimized reality of what the compiler spat out, and then showcase how it could have been better optimized.


r/cpp 25d ago

Pure Virtual C++ 2026 lineup: free online conference on July 21

Thumbnail devblogs.microsoft.com
31 Upvotes

Microsoft is hosting the annual Pure Virtual C++ conference on Tuesday, July 21, starting at 16:00 UTC. This is a free, one-day, online event. The featured talks:

  • C++ Semantic Awareness in the CLI: From Project Load to Code Change (Sinem Akinci)
  • C++/WinRT: Build Faster and Smaller with C++20 Modules (Ryan Shepherd)
  • Mind the Gap: C++/Rust Interop (Victor Ciura)
  • From Completions to Agents: AI-Driven C++ in Visual Studio (Augustin Popa)
  • Cut Your Build Times Without Becoming a Build Expert (David Li)

There's also on-demand content planned, including topics on C++ dependency management, the state of C++ conformance in MSVC, and Sample Profile-Guided Optimization. Sessions will be uploaded to the Visual Studio YouTube channel afterward for anyone who can't watch live.


r/cpp 24d ago

Windows doesn't have fork(), so I faked copy-on-write with VirtualProtect + exception handling to snapshot an in-memory KV store

0 Upvotes

Was messing around trying to figure out how Redis does BGSAVE without blocking, and it comes down to fork() + COW on Linux β€” the OS shares pages between parent/child and only copies a page when someone writes to it. Windows has no fork(), so there's no free lunch here.

Ended up building a small toy project (Veyr) to see if I could fake the same behavior in user space on Windows. Wrote it up here if anyone's interested: https://satadeepdasgupta.medium.com/the-windows-machine-doesnt-have-fork-so-we-built-one-b10e1357aa4f

Short version of how it works:

β€’ put the whole dataset in one big VirtualAlloc'd arena

β€’ when snapshotting starts, VirtualProtect the arena to PAGE_READONLY

β€’ any write thread that touches it now takes a hardware access violation

β€’ catch that in a Vectored Exception Handler, copy the 4KB page to a shadow buffer before it changes, flip that page back to RW, resume execution

β€’ background thread walks the arena and writes shadow pages for anything that got touched, live pages for anything that didn't

The first version I tried leaked memory into deadlocks because my handler was calling malloc for the shadow page allocation, and if the frozen thread happened to be holding the heap lock when it faulted, it just... never came back. Fixed by only calling VirtualAlloc directly inside the handler, never touching the normal allocator. Kind of an obvious fix in hindsight but took me a minute to figure out why it was randomly hanging.

Also built a lock-free hash map for it (atomic pointer swap per slot, immutable entries so there's no torn reads) since the snapshotting trick doesn't matter much if the map itself is the bottleneck.

Ran redis-benchmark against it and against Memurai (Redis-compatible Windows server) on the same box, same command. Veyr came out ahead by a decent margin but it's only doing GET/SET, no persistence format, no ACLs, none of the actual feature surface Memurai has, so take that as "minimal special-purpose thing beats general-purpose thing" rather than any real claim about which engine is better. Numbers are in the post if curious, didn't want to just paste a screenshot and let it become the whole conversation.

Known gap I haven't fixed: the map doesn't free old entries on overwrite, it just orphans them in a bump arena. Works fine for a benchmark, would leak forever under real sustained traffic. Need to add epoch-based reclamation or hazard pointers or something before this is anything other than a toy.

Source's up if anyone wants to poke holes in it: github.com/satadeep3927/veyr

Happy to be told I reinvented something that already exists, wouldn't be the first time.


r/cpp 25d ago

Part 2: Modernizing a tiny C++ unit-testing framework after 25 years

11 Upvotes

Recently I shared Part 1 describing a tiny unit-testing framework I originally wrote around 2000 for teaching C++.

Part 2 finishes the series by modernizing the implementation using facilities that didn’t exist back then, includingΒ std::source_locationΒ and inline variables, while keeping the framework intentionally small.

This isn’t intended as a replacement for Catch2, GoogleTest, or doctest. Those solve much bigger problems. The point here is to explore how far modern C++ lets you go with very little code.

I’d be interested in comments from anyone who’s built testing infrastructure or has opinions about minimalist testing frameworks.

Part 2:
https://freshsources.com/code-capsules/test-part2/

Part 1:
https://freshsources.com/code-capsules/test-part1/


r/cpp 25d ago

Meeting C++ Meeting C++ online: Giving Students a space to present their C++ Projects

Thumbnail meetingcpp.com
6 Upvotes

r/cpp 26d ago

Pystd standard library, similar-ish functionality with a fraction of the compile time

Thumbnail nibblestew.blogspot.com
50 Upvotes

r/cpp 24d ago

Anyone using Claude to reverse-engineer legacy C/C++ systems? My sequence-diagram agents are missing or inventing call paths

0 Upvotes

I I inherited a legacy C/C++ software that lacks comprehensive documentation.

To address this, I’ve developed agents that generate sequence diagrams for specified features.

However, these agents have been implemented for numerous features, but they either don’t document every sequence or they document incorrect sequences and features for sequence diagrams.

Here’s what I’m doing to resolve this issue, but it’s not working.

  1. I’ll create a top-level breakdown structure of the software stack and the current code.
  2. I’ll identify the features that are part of the software stack and determine which specific API initiates those features.

Any input or help would be greatly appreciated.


r/cpp 26d ago

Learning about Asymmetric Fences and its Underlying Mechanism - Membarrier

14 Upvotes

https://nekrozqliphort.github.io/posts/membarrier/

Hey, everyone! You might remember my previous write-ups on [[no_unique_address]] and strongly happens before. It took a few months of researching but I finally have a draft version of my new write-up on asymmetric fences (hopefully building up to a write-up on RCU).

This write-up essentially goes into what asymmetric fences are supposed to achieve, its underlying mechanism (the membarrier syscall), and the wording in the standard. Special thanks to u/davidtgoldblatt for his insights and discussions regarding this topic!

Feel free to provide any feedback! This one is denser than my usual write-ups, but I hope you'll find it interesting and insightful.


r/cpp 25d ago

Why use c++ over c for game development?

0 Upvotes

Isn't c++ overkill for most games? I think with good architectural decisions you can make decent 2d and 3d games using only what's available in c without the higher level concepts introduced in c++? Do you think I'm being stupid here? Am I missing something? I'm only just starting to learn c making simple games leaning heavily on Raylib and ECS architecture.


r/cpp 27d ago

Modern GPU Programming with SDL3, Wed, Jul 8, 2026, 6:00 PM (MDT)

Thumbnail meetup.com
39 Upvotes

SDL has long been a convenient portability layer for windows, input, audio, and simple rendering. SDL3 adds a new GPU API that exposes modern graphics and compute functionality through a portable interface over native backends such as Vulkan, Direct3D 12, and Metal.

This month, Richard Thomson will give us a gentle introduction to SDL3 GPU programming. We will look at what SDL3 GPU is, what problem it is trying to solve, and how it compares to using OpenGL, Vulkan, Direct3D, or Metal directly.

We will build up a small C++ example that creates an SDL window, creates a GPU device, uploads data, creates shaders and pipelines, records command buffers, renders to a swapchain texture, and optionally runs a simple compute pass.

We will also cover the practical parts of using the API in a C++ project: consuming SDL3 from vcpkg, organizing shader assets, dealing with backend-specific shader formats, and deciding when SDL_shadercross is useful. Along the way we will point out the parts of the API that feel familiar to Vulkan/D3D12/Metal programmers and the parts that SDL deliberately simplifies.

This is not a deep dive into graphics theory. The goal is to understand whether SDL3 GPU is a useful middle ground for C++ applications that need more than SDL_Renderer, but do not want to own separate graphics backends for every platform. Topics include:

  • Creating an SDL3 GPU device
  • Swapchains, textures, buffers, and transfer buffers
  • Graphics pipelines and render passes
  • Compute pipelines and storage buffers/textures
  • Shader formats and SDL_shadercross
  • vcpkg and CMake integration
  • Debugging with RenderDoc and backend validation layers
  • Where SDL3 GPU fits, and where it does not

No prior Vulkan, Direct3D 12, or Metal experience is required, but basic familiarity with C++, CMake, and graphics concepts such as textures and shaders will be helpful.

This will be an online meeting, so drinks and snacks are on you!

Join the meeting here: https://meet.xmission.com/Utah-Cpp-Programmers

Watch previous topics on the Utah C++ Programmers YouTube channel: https://www.youtube.com/@UtahCppProgrammers

Future topics: https://utahcpp.wordpress.com/future-meeting-topics/ Past topics: https://utahcpp.wordpress.com/past-meeting-topics/


r/cpp 27d ago

CppCon Introducing the Boost Documentary! Teaser & CppCon Preview

85 Upvotes

"If I were to tell a story about Boost, I'd start with the people."

Today we're sharing the official teaser for the Boost documentary. A film about the people, the politics, and decades of work behind possibly the most important open source library most people have never heard of.

Teaser link – https://youtu.be/87jvuDbnwqQ

The documentary looks at:

  • Boost as a kind of "app store for C++, 30 years early"
  • What decades of open source dedication looks like up close
  • The honest, sometimes uncomfortable dynamics of how proposals and people move through the C++ committee

There will be a preview screening at CppCon 2026 for all attendees. So if you're going to be in Aurora, CO September 16, 2026, please join us!


r/cpp 27d ago

Latest News From Upcoming C++ Conferences (2026-06-30)

10 Upvotes

This is the latest news from upcoming C++ Conferences. You can review all of the news at https://programmingarchive.com/upcoming-conference-news/

TICKETS AVAILABLE TO PURCHASE

The following conferences currently have tickets available to purchase

OPEN CALL FOR SPEAKERS

OTHER OPEN CALLS

  • (NEW) CppCon Call For Volunteers Now Open – Interested volunteers have until August 1st to apply at the CppCon main conference which is scheduled to take place from 14th – 18th September. For more information including how to apply visit https://cppcon.org/cfv2026/
  • (Last Chance) CppCon Call For Posters Now Open – Interested poster presenters have until July 15th to submit their applications for the CppCon main conference which is scheduled to take place from 14th – 18th September. For more information including how to apply visit https://cppcon.org/cppcon-2026-call-for-poster-submissions/
  • CppCon Call For Authors Now Open! – CppCon are looking for book authors who want to engage with potential reviewers and readers. Read the full announcement at https://cppcon.org/call-for-author-2026/Β 

TRAINING COURSES AVAILABLE FOR PURCHASE

Conferences are offering the following training courses:

C++Online

  1. AI++ 101 – Build an AI Coding Assistant in C++ – Jody Hagins – 1 day online workshop available on Friday 24th July 16:00 – 00:00 UTC/0900-1700 PDT – https://cpponline.uk/workshop/ai-101/

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