r/cpp • u/NicoJosuttis • Jun 25 '26
Examples of C++23 - The Complete Guide
More than 150 examples of C++23 can be found now at www.cppstd23.com.
I hope it helps.
r/cpp • u/NicoJosuttis • Jun 25 '26
More than 150 examples of C++23 can be found now at www.cppstd23.com.
I hope it helps.
r/cpp • u/Acrobatic-Stable2537 • Jun 25 '26
I open-sourced my dependency injection library.
Link: https://github.com/n0F4x/redi
This was developed for my game engine.
I am giving this project to the community so that everybody can benefit. This kind of approach is mostly useful when dealing with intricate systems, such as a plugin system. I welcome all kinds of feedback, as this was mostly a learning opportunity for me. If you'd like to use this in your project but don't have access to the required compiler features, let me know, and I'll see if I can reduce the requirements.
r/cpp • u/SubstanceHot5190 • Jun 25 '26
I asked this question in the C programming sub too.
What are some things you don't like about C++
If you were to change some things about C++, add keywords, or other similar things,
what would you change? Replace? Add?
My most important question is about keywords. What keyword would you add ( even just describing its functionality) to help YOU as a programmer?
Thank you :)
r/cpp • u/minshinji • Jun 25 '26
We're about 30 engineers split across Windows and Linux, with a handful on macOS. All C++, CMake + Ninja as the build sytem. The compiler situation is where it gets messy. Someone's always on a slightly different version and it surfaces in the strangest ways, usually right before a release.
We've gone back and forth on a few approaches...pinning versions across machines, containerizing the build environment, leaning on build servers and treating local builds as second-class, or some mix. None feel clean. All have tradeoffs, and the tradeoff's shift depending on the platform.
What's held up at a similar scale?
r/cpp • u/madnirua • Jun 24 '26
r/cpp • u/EricLikesTrains • Jun 24 '26
Greetings,
This is a link to our learning guide to make your own MCP server in C/C++ (with no other dependencies). If you wanted to make one from scratch but needed some insight into dealing with MCP messages: the I/O flow, JSON parsing, and request dispatch, grab the teaching version tagged mcp/teaching/v1.0.0 in the repository. The JSON parsing in C would have been a hurdle, but then there's this amusing story:
Eric: "Let's create a helloWorld MCP server in C."
Gemini: "That will be somewhat difficult, there are easier ways."
Eric: "Why is it difficult??" (the second '?' was a bit of my ego).
Gemini: "Well, you'll need to parse JSON, handle raw I/O, and return strict JSON-RPC back to the client."
Eric: "One moment....", attaching a decade-old JSON parser engine file JSONParser.h
Amusingly, the AI read the code and completely shifted its tone...
Gemini: "Oh, well then it's not so difficult."
The head revision plus the aspect guide gets you a self-diagnosing, asynchronous, enterprise-ready baseline to be able to concentrate on what you really want your own MCP Server to do. I would begin with the repository README.md though, because it's actually as easy to use as it describes.
Cheers,
... Eric
r/cpp • u/osmiouselderberry • Jun 24 '26
Hey everyone,
I'm currently building a real-time object tracker from scratch in C++17 for the Raspberry Pi 5, with the goal of achieving 100+ FPS on CPU-only hardware. The project is based on correlation filters and FFT-based signal processing, with no machine learning, no neural networks, and no OpenCV in the core tracking pipeline.
The motivation is simple: a straightforward OpenCV-based implementation on the Pi only gets me around 15 FPS, which seems far below what this class of algorithms should be capable of. From both the literature and projects I've come across, the gap appears to be in implementation and system overhead rather than the underlying tracking method itself.
Right now, my plan is to build the pipeline around:
The area I'm currently spending the most time researching is the FFT layer. I'm trying to determine whether the best approach on the Pi 5 is:
To better understand the design space, I've also been looking into modern transformer-based visual trackers. They jointly process information from a target template and a search region, making them much more semantically aware and capable of handling challenging scenarios such as partial occlusions or target disappearance with automatic re-acquisition. The downside is that they are significantly heavier computationally and can be difficult to deploy efficiently on constrained edge hardware.
On the more classical side, I'm currently reading about Discriminative Scale Space Tracking (DSST). One of the main limitations of basic correlation-filter trackers is that they often assume the target size remains constant. DSST addresses this by learning a separate correlation filter across multiple image scales, allowing the tracker to estimate changes in object size efficiently while still maintaining real-time performance. It seems like an elegant way to improve robustness without giving up the speed advantages that make correlation filters attractive in the first place.
Exploring these different approaches has been interesting because they represent very different trade-offs: transformer-based methods emphasize robustness and semantic understanding, while correlation-filter methods prioritize simplicity, efficiency, and extremely high throughput.
If you've worked on correlation-filter trackers, embedded computer vision, real-time image processing, high-performance C++, drone tracking, or ARM optimization, I'd really appreciate your perspective.
Some questions I'm hoping to get insight on:
Beyond getting the core tracker running efficiently, some areas I'd like to explore include:
I'm not looking for someone to redesign the project or suggest replacing it with deep learning. My goal is to understand where the real bottlenecks are and learn from people who've already built or optimized similar systems before I spend weeks optimizing the wrong component.
If you've worked on anything similar, or achieved high frame rates with classical tracking methods, I’d love to hear about your experience, benchmark results, profiling insights, or even things that didn't work. Thanks in advance!
r/cpp • u/anish2good • Jun 24 '26
Built a platform where you can visualise your own cpp code datastructure and concurrency side by side supported one
Try it here https://8gwifi.org/online-cpp-compiler/
Feedback and Bug's Welcomed for Improvement
r/cpp • u/bothsecuritylab • Jun 24 '26
How do you design a media engine that balances high-performance video decoding, real-time DSP audio processing, cryptographic security, and automated media acquisition?
I recently analyzed the core architecture of Both Player (Titan Engine) — a cross-platform media engine that combines low-level C++ performance with high-level Python flexibility.
1. GPU-First Rendering
2. Advanced Audio Pipeline
3. Smart Media Acquisition
4. Quantum Vault Security
5. Interactive UX
Both Player reflects a modern hybrid architecture:
This balance delivers both raw performance and rapid adaptability.
What are your thoughts on hybrid C++/Python media architectures?
How do you handle ultra-low-latency audio-video synchronization in your pipelines?
Let’s discuss. 💬
#Cpp #Qt6 #FFmpeg #OpenGL #SoftwareArchitecture #MediaEngineering #OpenSource
r/cpp • u/Weary-Inspector-4297 • Jun 23 '26
I recently revisited a tiny unit-testing framework I originally developed for teaching C++ students.
The goal was to strip testing down to the essentials: a single header file with macros for expression testing, exception verification, and source-location reporting.
Looking back at the design today is interesting because it predates features such as inline variables, modules, and std::source_location. In the article I walk through the implementation and discuss the limitations that Part 2 will address.
Feedback from people who have built or maintained test frameworks would be especially welcome.
r/cpp • u/trailing_zero_count • Jun 23 '26
Repo: https://github.com/tzcnt/coro_util
Documentation: https://fleetcode.com/oss/coro_util/docs/queues/index.html
coro_util is a collection of data structures for C++20 coroutines that aren't tied to any task or executor library. Each structure is a template that accepts a policy object which binds it to your library of choice. I've include pre-configured adapters for several libraries: YACLib, Boost.Cobalt, Asio, Boost.Capy, libfork, concurrencpp, cppcoro, and libcoro. Adding a custom adapter for your own library is also relatively simple, and I've provided an agent prompt that automates it.
These queues were all written for the TooManyCooks framework, which as far as I know, has the most complete suite of general purpose async data structures of any publicly available library. This first edition only includes the 5 queues. The next batch will include the control structures (mutex, semaphore, etc.). I've decided to port them to be dependency-free in an effort to advance the interoperability of the C++20 coroutine ecosystem, which IMO is too siloed right now. I aim to demonstrate and evangelize for a style of code that is "sans-executor/task".
All of the queues are lock-free and wait-free on the fast path, and offer purely zero-copy operation. They have been rigorously tested and examined over their lifetime in TooManyCooks, and I believe them to be production-ready.
r/cpp • u/zerexim • Jun 23 '26
r/cpp • u/Huge-Presentation810 • Jun 23 '26
I've been working on a compile-time Dependency Injection framework for modern C++:
https://github.com/steumarok/cpp_di_manager
The main idea is a policy-based resolution pipeline where object creation, dependency injection, casting, lifetime management and scope creation are handled by independent compile-time policies.
Unlike traditional DI containers that are primarily organized around service lifetimes, the framework is built around the following pipeline:
Requested Type
↓
Resolution Policy
↓
Creation Policy
↓
Injection Policy
↓
Cast Policy
↓
Returned Type
Current features:
std::function<T()>)Example web application:
https://github.com/steumarok/cpp_di_manager/blob/main/example.cpp
I'm particularly interested in feedback about:
Suggestions and criticism are very welcome.
r/cpp • u/ajmmertens • Jun 23 '26
New blog post on why & how to integrate hierarchies with an Entity Component System.
r/cpp • u/meetingcpp • Jun 23 '26
r/cpp • u/john-connor98 • Jun 23 '26
While learning modern C++ concurrency, I noticed many developers understand mutexes but are less familiar with the situations where std::unique_lock is preferable to std::lock_guard.
Some features that surprised me:
- Deferred locking (std::defer_lock)
- Manual unlock/relock
- Ownership transfer through move semantics
- Compatibility with condition variables
Example:
std::mutex mtx;
void worker()
{
std::unique_lock<std::mutex> lock(mtx);
// critical section
lock.unlock();
// non-critical work
lock.lock();
// critical section again
}
Thread
|
|---- lock() ---- Critical Section ---- unlock() ---- Non-Critical ---- lock() ---- Critical ----
For experienced C++ developers:
r/cpp • u/NicoJosuttis • Jun 22 '26
The C++ community is probably happy to hear that my new book in the "The Complete Guide" series is out now as a draft ebook: C++23 - The Complete Guide
So far, the book has 350 pages and is only about 80% complete. However, most of the C++23 features are covered already. For details of the current content, look at www.cppstd23.com. There you can also find several example programs demonstrating how all the new features can be used.
You can order the book at leanpub.com/cpp23 for a reduced price and will get all updates for free. This way, you have early access to details of the new features and I have early income and can process feedback from you for the final version, which will also be available as hardcover (not included).
I hope it helps.
r/cpp • u/robwirving • Jun 22 '26
r/cpp • u/ProgrammingArchive • Jun 22 '26
r/cpp • u/mborland1 • Jun 22 '26
The Boost Formal Review of the Corosio and Capy libraries will begin on June 23, 2026 and will conclude on July 7, 2026.
The review manager for these reviews will be Jeff Garland and the libraries are brought to you by Vinnie Falco. Since this is a two library review the period is somewhat extended from normal.
Capy is a coroutine foundation library providing task types, execution contexts, executors, asynchronous synchronization primitives, buffer abstractions, and coroutine composition facilities. It serves as the execution and asynchronous programming substrate upon which Corosio is built.
Repository:
Corosio is a coroutine-native asynchronous I/O library for C++20. It provides networking and I/O facilities designed specifically for coroutines, with awaitable operations, executor affinity, cancellation support, and cross-platform implementations based on IOCP, epoll, and kqueue.
Repository:
Potential reviewers are encouraged to consider the following questions:
Please post your review to the Boost Developers mailing list. Reviews from both experienced Boost contributors and first-time reviewers are encouraged. Reports based on real-world usage, experimentation, code inspection, and documentation review are all valuable contributions.
At the conclusion of the review period, the review manager will consider all feedback and determine whether the libraries should be accepted into Boost.
We look forward to your participation in this review.
If you have any questions or need assistance please let me know.
Matt - Boost Review Wizard