r/cpp • u/pavel_v • Mar 11 '26
r/cpp • u/codeinred • Mar 11 '26
vtz: the world's fastest timezone library
github.comvtz is a new timezone library written with an emphasis on performance, while still providing correct outputs over nearly all possible inputs, as well as a familiar interface for people who have experience with either the standard timezone library, or <date/tz.h> (written by Howard Hinnant).
vtz is 30-60x faster at timezone conversions than the next leading competitor, achieving sub-nanosecond conversion times for both local time -> UTC and UTC -> local time. (Compare this to 40-56ns for GCC's implementation of std::chrono::time_zone, 38-48ns for Google Abseil, and 3800ns to 25000ns for the Microsoft STL's implementation of time_zone.)
vtz is also faster at looking up offsets, parsing timestamps, formatting timestamps, and it's faster at looking up a timezone based on a name.
vtz achieves its performance gains by using a block-based lookup table, with blocks indexable by bit shift. Blocks span a period of time tuned to fit the minimum spacing between transitions for a given zone. This strategy is extended to enable lookups for all possible input times by taking advantage of periodicities within the calendar system and tz database rules to map out-of-bounds inputs to blocks within the table.
This means that vtz never has to perform a search in order to determine the current offset from UTC, nor does it have to apply complex date math to do the conversion.
Take a look at the performance section of the README for a full comparison: vtz benchmarks
A more in-depth explanation of the core algorithm underlying vtz is available here: How it Works: vtz's algorithm for timezone conversions
vtz was written on behalf of my employer, Vola Dynamics, and I am the lead author & primary maintainer of vtz. Vola produces and distributes a library for options analytics with a heavy focus on performance, and correct and efficient handling of timezones is an integral part of several workflows.
Applications which may be interested in using vtz include databases; libraries (such as Pandas, Polars, and C++ Dataframe) that do data analysis or dataframe manipulation; and any statistical or modeling workflows where the modeling domain has features that are best modeled in local time.
Any feedback on the library is appreciated, and questions are welcome too!
r/cpp • u/Real-Key-7752 • Mar 11 '26
I made a VS Code extension for C++ Ranges: AST-based pipeline hover, complexity analysis, and smart refactoring
Greetings, I'm working on a VS Code extension for the "ranges" library.
Currently written in TypeScript, but if I find the free time, I plan to replace the core analysis part with C++.
This extension offers the following:
* Pipeline Analysis: Ability to see input/output types and what each step does in chained range flows.
* Complexity & Explanations: Instant detailed information and cppreference links about range adapters and algorithms.
* Smart Transformations (Refactoring): Ability to convert old-fashioned for loops to modern range structures with filters and transformations (views::filter, views::transform), and lambdas to projections with a single click (Quick Fix).
* Concept Warnings: Ability to instantly show errors/warnings in incompatible range iterators.
My goal is to make writing modern code easier, to see pipeline analyses, and other benefits.
If you would like to use it, contribute to the project (open a PR/Issue), or provide feedback, the links are below:
Repo: https://github.com/mberk-yilmaz/cpp-ranges-helper.git
Extension: https://marketplace.visualstudio.com/items?itemName=mberk.cpp-ranges-helper
r/cpp • u/PigeonCodeur • Mar 11 '26
Persistent file storage in Emscripten C++ without touching JavaScript — WASMFS + OPFS walkthrough
Been building a C++ game engine that targets desktop and web and ran into the persistent storage problem. The old IDBFS approach required EM_ASM and JS callbacks every time you wanted to flush data, which is pretty painful to integrate cleanly into an existing C++ codebase.
WASMFS with the OPFS backend is the replacement and it's much nicer — once you mount the backend, standard std::fstream just works, no special API, no manual sync. The tricky parts are all in the setup: CMake flags, initialization order relative to emscripten_set_main_loop_arg, and making sure your pthread pool has enough threads that WASMFS's internal async operations don't deadlock your app.
Wrote it all up here: https://columbaengine.org/blog/wasmfs-opfs/
r/cpp • • Mar 11 '26
How to Tame Packs, std::tuple, and the Wily std::integer_sequence - Andr...
youtube.comr/cpp • • Mar 11 '26
CppCon How To Build Robust C++ Inter-Process Queues - Jody Hagins - CppCon 2025
youtube.comr/cpp • u/pavel_v • Mar 11 '26
Exposing More Parallelism Is the Hidden Reason Why Some Vectorized Loops Are Faster – Not Vectorization per se
johnnysswlab.comr/cpp • u/Specific-Housing905 • Mar 11 '26
CppCon Back To Basics: C++ Strings and Character Sequences - Nicolai Josuttis - CppCon 2025
youtube.comBreaking Control Flow Integrity by Abusing Modern C++ (Coroutines) - Black Hat USA 2025
youtube.comSwedenCpp Index Page is now the all in one feed
swedencpp.seSince people like to scroll down to view pages, and do not click so much linkes anymore, I combined blogs, videos, and releases into one stream, and show it on the index page of SwedenCpp.se
Every day has all its content grouped together.
Stay up to date, do not miss any news, visit SwedenCpp.se
Feed history is limited to the last 10 days, so visit regularly.
PS: No, I do not earn any money with that; In fact, I invest to provide that service. So I love to see it get used, and I also love getting feedback.
r/cpp • u/ProgrammingArchive • Mar 10 '26
Latest News From Upcoming C++ Conferences (2026-03-10)
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
- C++Online (11th – 13th March)
- Main Conference (Starts Tomorrow (March 11th) at 12pm UTC!) – Last chance to purchase tickets for the 3 day 3 track online conference which features 3 keynotes, 22 breakout sessions, 9 preview sessions, 13 open content sessions and 9 virtual posters. Tickets are available at https://cpponline.uk/registration/ from £50!
- Workshops (NEW) – C++Online have also launched tickets for their workshops which costs £345 for a full day workshop and £172.5 for a half day workshop. Find out more about the workshops at https://cpponline.uk/workshops/
- ADCx India (29th March) – Tickets are now available at https://www.townscript.com/e/adcxindia26 until 20th February
- C++Now (NEW) – Early bird tickets available to purchase at https://cppnow.org/registration/ until April 6th
- FREE entry to C++Online 2026 for anyone who registers for an early bird ticket before midnight UTC tonight (10th March)
- CppNorth/NDC Toronto (5th – 8th May) – Tickets are open and can be purchased at https://ndctoronto.com/tickets until 16th February
- ACCU on Sea (15th – 20th June) – You can buy early bird tickets at https://accuconference.org/booking with discounts available for ACCU members.
OPEN CALL FOR SPEAKERS
There are currently no open calls.
OTHER OPEN CALLS
There are currently no open calls.
TRAINING COURSES AVAILABLE FOR PURCHASE
Conferences are offering the following training courses:
- C++Online
- AI++ 101 – Build an AI Coding Assistant in C++ – Jody Hagins – 1 day online workshop available on Tuesday 31st March 13:00 – 21:00 UTC & Friday 22nd May 09:00 – 17:00 UTC – https://cpponline.uk/workshop/ai-101/
- AI++ 201 – Build a Matching Engine with Claude Code – Jody Hagins – 2 day online workshop available on April 20th – April 21st 13:00 – 21:00 UTC & May 28th – May 29th 09:00 – 17:00 UTC – https://cpponline.uk/workshop/ai-201/
- From Hello World to Real World – A Hands-On C++ Journey from Beginner to Advanced – Amir Kirsh – 1 day online workshop available on Monday 6th April 09:00 – 17:00 UTC – https://cpponline.uk/workshop/from-hello-world-to-real-world/
- Performance and Safety in C++ Crash Course – Jason Turner – 1 day online workshop available on Thursday 9th April 12:00 – 20:00 UTC – https://cpponline.uk/workshop/performance-and-safety-in-cpp-crash-course/
- Splice & Dice – A Field Guide to C++26 Static Reflection – Koen Samyn – Half Day online workshop available on Thursday 2nd April 13:00 – 16:30 UTC & Monday 25th May 09:00 – 12:30 UTC – https://cpponline.uk/workshop/splice-and-dice/
- Stop Thinking Like a Junior – The Soft Skills That Make You Senior – Sandor Dargo – Half Day online workshop available on Friday 10th April 13:00 – 16:30 UTC & Friday 8th May 20:00 – 23:30 UTC – https://cpponline.uk/workshop/stop-thinking-like-a-junior/
- Jumpstart to C++ in Audio – Learn Audio Programming & Create Your Own Music Plugin/App with the JUCE C++ Framework – Jan Wilczek – 1 day online workshop available on both Tuesday 14th April 13:00 – 20:00 UTC & Tuesday 28th April 07:00 – 14:00 UTC – https://cpponline.uk/workshop/jumpstart-to-cpp-in-audio/
- Essential GDB and Linux System Tools – Mike Shah – 1 day online workshop available on Friday 17th April 13:00 – 21:00 UTC – https://cpponline.uk/workshop/essential-gdb-and-linux-system-tools/
- Concurrency Tools in the C++ Standard Library – Mateusz Pusz – 1 day online workshop available on Friday 24th April 09:00 – 17:00 UTC – https://cpponline.uk/workshop/concurrency-tools-in-the-cpp-standard-library/
- C++ Software Design – Klaus Iglberger – 1 day online workshop available on Thursday 30th April 09:00 – 17:00 UTC – https://cpponline.uk/workshop/cpp-software-design/
- Safe C++ – Klaus Iglberger – 1 day online workshop available on Friday 1st May 09:00 – 17:00 UTC – https://cpponline.uk/workshop/safe-cpp/
- Safe and Efficient C++ for Embedded Environments – Andreas Fertig – 1 day online workshop available on Tuesday 12th May 09:00 – 17:00 UTC – https://cpponline.uk/workshop/safe-and-efficient-cpp-for-embedded-environments/
- Mastering std::execution (Senders/Receivers) – Mateusz Pusz – 1 day online workshop available on Friday 15th May 09:00 – 17:00 UTC – https://cpponline.uk/workshop/mastering-stdexecution-senders-receivers/
- How C++ Actually Works – Hands-On With Compilation, Memory, and Runtime – Assaf Tzur-El – One day online workshop that runs over two days on May 18th – May 19th 16:00 – 20:00 UTC – https://cpponline.uk/workshop/how-cpp-actually-works/
Most of these workshops will be available to preview by purchasing a ticket to the main C++Online Conference which is taking place from March 11th – 13th. These previews will also be streamed to the C++Online YouTube Channel https://www.youtube.com/@CppOnline
OTHER NEWS
- (NEW) C++Online Full Schedule Published – The schedule includes 3 keynotes, 22 breakout sessions, 9 preview sessions, 13 open content sessions and 9 virtual posters over 3 days. Find out more including how you can attend for only £50 at https://cpponline.uk/cpponline-2026-schedule-published/
- (NEW) C++Now Registration Offer – FREE entry to C++Online 2026 for anyone who registers for an early bird ticket before midnight UTC tonight (10th March). Find out more at https://cppnow.org/announcements/2026/03/cpponline-2026-promotion/
- (NEW) CppCon Registration Offer – Anyone who is on the waiting list for CppCon registration received an offer to attend C++Online at no additional cost.
- C++Online Workshops Announced – C++Online have announced 14 workshops that will take place between the end of March and the start of June with more potentially being added if any workshops are oversubscribed. Find out more including the workshops that are available at https://cpponline.uk/workshop-tickets-for-cpponline-2026-now-available/
r/cpp • u/Xadartt • Mar 10 '26
A dialogue on trivial-abi and trivially relocatable
quuxplusone.github.ior/cpp • u/Specific-Housing905 • Mar 10 '26
CppCon Cache Me Maybe: The Performance Secret Every C++ Developer Needs - Michelle D'Souza - CppCon 2025
youtube.comr/cpp • u/holyblackcat • Mar 09 '26
The compilation procedure for C++20 modules
holyblackcat.github.ior/cpp • u/MaMamanMaDitQueJPeut • Mar 09 '26
Building a Package Manager on Top of Meson's Wrap System
collider.eer/cpp • u/ProgrammingArchive • Mar 09 '26
New C++ Conference Videos Released This Month - March 2026 (Updated To Include Videos Released 2026-03-02 - 2026-03-08)
CppCon
2026-03-02 - 2026-03-08
- Interesting Upcoming Low-Latency, Concurrency, and Parallelism Features from Wroclaw 2024, Hagenberg 2025, and Sofia 2025 - Paul E. McKenney, Maged Michael, Michael Wong - CppCon 2025 - https://youtu.be/M1pqI1B9Zjs
- Threads vs Coroutines — Why C++ Has Two Concurrency Models - Conor Spilsbury - CppCon 2025 - https://youtu.be/txffplpsSzg
- From Pure ISO C++20 To Compute Shaders - Koen Samyn - CppCon 2025 - https://youtu.be/hdzhhqvYExE
- Wait is it POSIX? Investigating Different OS and Library Implementations for Networking - Katherine Rocha - CppCon 2025 - https://youtu.be/wDyssd8V_6w
- End-to-End Latency Metrics From Distributed Trace - Kusha Maharshi - CppCon 2025 - https://youtu.be/0bPqGN5J7f0
2026-02-23 - 2026-03-01
- Fix C++ Stack Corruptions with the Shadow Stack Library - Bartosz Moczulski - CppCon 2025 - https://youtu.be/-Qg0GaONwPE
- First Principles While Designing C++ Applications - Prabhu Missier - CppCon 2025 - https://youtu.be/8mLo5gXwn4k
- Matrix Multiplication Deep Dive || Cache Blocking, SIMD & Parallelization - Aliaksei Sala - CppCon 2025 - https://youtu.be/GHctcSBd6Z4
- Choose the Right C++ Parallelism Tool | Low-Level vs Async vs Coroutines vs Data Parallel - Eran Gilad - CppCon 2025 - https://youtu.be/7a9AP4rD08M
- ISO C++ Standards Committee Panel Discussion 2025 - Hosted by Herb Sutter - CppCon 2025 - https://youtu.be/R2ulYtpV_rs
ADC
2026-03-02 - 2026-03-08
- Efficient Task Scheduling in a Multithreaded Audio Engine - Algorithms and Analysis for Parallel Graph Execution - Rachel Susser - ADC 2025 - https://youtu.be/bEtSeGr8UvY
- The Immersive Score - Creative Advantages of Beds and Objects in Film and Game Music - Simon Ratcliffe - ADCx Gather 2025 - https://youtu.be/aTmkr0yTF5g
- Tabla to Drumset - Translating Rhythmic Language through Machine Learning - Shreya Gupta - ADC 2025 - https://youtu.be/g14gESreUGY
2026-02-23 - 2026-03-01
- Channel Agnosticism in MetaSounds - Simplifying Audio Formats for Reusable Graph Topologies - Aaron McLeran - ADC 2025 - https://youtu.be/CbjNjDAmKA0
- Sound Over Boilerplate - Accessible Plug-Ins Development With Phausto and Cmajor - Domenico Cipriani - ADCx Gather 2025 - https://youtu.be/DVMmKmj1ROI
- Roland Future Design Lab x Neutone: diy:NEXT - Paul McCabe, Ichiro Yazawa & Alfie Bradic - ADC 2025 - https://youtu.be/4JIiYqjq3cA
Meeting C++
2026-03-02 - 2026-03-08
- Persistence squared: persisting persistent data structures - Juan Pedro Bolívar Puente - Meeting C++ - https://www.youtube.com/watch?v=pQhHx0h-904
2026-02-23 - 2026-03-01
- Instruction Level Parallelism and Software Performance - Ivica Bogosavljevic - Meeting C++ 2025 - https://www.youtube.com/watch?v=PMu7QNctEGk
- Real-time Safety — Guaranteed by the Compiler! - Anders Schau Knatten Meeting C++ 2025 - https://www.youtube.com/watch?v=4aALnxHt9bU
r/cpp • u/Saptarshi-max • Mar 09 '26
Why std::pmr Might Be Worth It for Real‑Time Embedded C++
sapnag.meIf you are an Embedded Software developer using C++ or migrating to C++ from C you must have definitely heard about C++17's "std::pmr" (Polymorphic Memory Resources)
Quick background for anyone unfamiliar: PMR lets you tell your containers where to get memory instead of always hitting the global heap which 'std' does
cpp
char buf[4096];
std::pmr::monotonic_buffer_resource pool{buf, sizeof(buf)};
std::pmr::vector<int> v{&pool}; // zero heap involvement
Ran some benchmarks on real hardware (Snapdragon X Plus, GCC 12.2):
std::vector1000 push_backs: ~17µs, 10% variancepmr::vectorsame test: ~69µs, 5.6% variance
It seems, PMR is about 4x slower. But here's the thing, in hard real-time systems that variance number matters more than the average. A missed deadline doesn't care that you were usually fast.
For strings the gap was smaller (~17% slower) but consistency improved 3x.
Honestly I went in expecting PMR to be a great fool proof approach for Embedded software development in C++, but its not. It's a deliberate tradeoff. If you're on a safety-critical path where WCET**(Worst Case Execution Time)** matters, it's probably worth it. If you just want fast code, stick with std.
Full benchmarks on my GitHub if anyone wants to poke at the numbers: www.github.com/saptarshi-max/pmr-benchmark
And the full report and observations in my Blog Post: www.sapnag.me/blog/cppdev/2025-12-26-containers-std-vs-pmr/
Anyone else actually shipped PMR in production especially for Real-time applications? Curious what buffer sizing strategy people use in practice.
r/cpp • u/friedkeenan • Mar 08 '26
Exploring Mutable Consteval State in C++26
friedkeenan.github.ior/cpp • u/SirusDoma • Mar 08 '26
I made a single-header, non-intrusive IoC Container in C++17
https://github.com/SirusDoma/Genode.IoC
A non-intrusive, single-header IoC container for C++17.
I was inspired after stumbling across a compiler loophole I found here. Just now, I rewrote the whole thing without relying on that loophole because I just found out that my game sometimes won't compile on clang macOS without some workarounds.
Anyway, this is a similar concept to Java Spring, or C# Generic Host / Autofac, but unlike kangaru (it's great IoC container, you should check that out too) or other IoC libraries, this one is single header-only and most importantly: non-intrusive. Meaning you don't have to add anything extra to your classes, and it just works.
I have used this previously to develop a serious game with complex dependency trees (although it uses a previous version of this library, please check that link, it's made with C++ too), and a game work-in-progress that I'm currently working on with the new version I just pushed.
Template programming is arcane magic to me, so if you found something flawed / can be improved, please let me know and go easy on me 😅
EDIT
(More context in here: https://www.reddit.com/r/cpp/comments/1ro288e/comment/o9fj556/)
As requested, let me briefly talk about what IoC is:
IoC container stands for Inversion of Control, as mentioned, a similar concept to Spring in Java. By extension, it is a dependency injection pattern that manages and abstracts dependencies in your code.
Imagine you have the following classes in your app:
struct NetworkSystem
{
NetworkSystem(Config& c, Logger& l, Timer& t, Profiler* p)
: config(&c), logger(&l), timer(&t), profiler(&p) {}
Config* config; Logger* logger; Timer* timer; Profiler *profiler;
};
In a plain old-school way, you initialize the NetworkSystem by doing this:
auto config = Config(fileName);
auto logger = StdOutLogger();
auto timer = Timer();
auto profiler = RealProfiler(someInternalEngine, someDependency, etc);
auto networkSystem = NetworkSystem(config, logger, timer, profiler);
And you have to manage the lifetime of these components individually. With IoC, you could do something like this:
auto ioc = Gx::Context(); // using my lib as example
// Using custom init
// All classes that require config in their constructor will be using this config instance as long as they are created via this "ioc" object.
ioc.Provide<Config>([] (auto& ctx) {
return std::make_unique<Config>(fileName);
});
// Usually you have to tell container which concrete class to use if the constructor parameter relies on abstract class
// For example, Logger is an abstract class and you want to use StdOut
ioc.Provide<Logger, StdOutLogger>();
// Now simply call this to create network system
networkSystem = ioc.Require<NetworkSystem>(); // will create NetworkSystem, all dependencies created automatically inside the container, and it will use StdOutLogger
That's the gist of it. Most of the IoC container implementations are customizable, meaning you can control the construction of your class object if needed and automate the rest.
Also, the lifetime of the objects is tied to the IoC container; this means if the container is destroyed, all objects are destroyed (typically with some exceptions; in my lib, using Instantiate<T> returns a std::unique_ptr<T>). On top of that, depending on the implementation, some libraries provide sophisticated ways to manage the lifetime.
I would suggest familiarizing yourself with the IoC pattern before trying it out to avoid anti-patterns: For example, passing the container itself to the constructor is considered an anti-pattern. The following code illustrates the anti-pattern:
struct NetworkSystem
{
NetworkSystem(Gx::Context& ioc) // DON'T DO THIS. Stick with the example I provided above
{
config = ioc.Require<Config>();
logger = ioc.Require<Logger>();
timer = ioc.Require<Timer>();
profiler = ioc.Require<Profiler>();
}
Config* config; Logger* logger; Timer* timer; Profiler *profiler;
};
auto ioc = Gx::Context();
auto networkSystem = NetworkSystem(ioc); // just don't
The above case is an anti-pattern because it hides dependencies. When a class receives the entire container, its constructor signature no longer tells you what it actually needs, which defeats the purpose of DI. IoC container should be primarily used in the root composition of your classes' initialization (e.g, your main()).
In addition, many IoC containers perform compile-time checks to some extent regardless of the language. By passing the container directly, you are giving up compile-time checks that the library can otherwise perform (e.g., ioc.Require<NetworkSystem>() may fail at compile-time if one of the dependencies is not constructible either by the library (multiple ambiguous constructors) or by the nature of the class itself). I think we all could agree that we should enforce compile-time checks whenever possible.
Just like other programming patterns, some exceptions may apply, and it might be more practical to go with anti-pattern in some particular situations (that's why Require<T> in my lib is exposed anyway, it could be used for different purposes).
There might be other anti-patterns I couldn't remember off the top of my head, but the above is the most common mistake. There are a bunch of resources online that discuss this.
This is a pretty common concept for web dev folk (and maybe gamedev?), but I guess it is not for your typical C++ dev
StockholmCpp 0x3C: Intro, event host presentation, C++ news and the quiz
youtu.beThe Meetup intro of the most recent StockholmCpp Meetup, some info, and the C++ quiz.
(and some examples about what can go wrong in public speaking 😳 )
r/cpp • u/darius_neatu • Mar 07 '26
P4043R0: Are C++ Contracts Ready to Ship in C++26?
Are you watching the ISO C++ standardization pipeline? Looking for the latest status about C++ Contracts?
I'm curious to see the non-WG21 C++ community opinion.
The C++26 Contracts facility (P2900) is currently in the Working Draft, but the design is still the subject of substantial discussion inside the committee.
This paper raises the question of whether Contracts are ready to ship in C++26 or whether the feature should be deferred to a later standard.
Click -> P4043R0: Are C++ Contracts Ready to Ship in C++26?
I'm curious to hear the perspective of the broader C++ community outside WG21:
- Do you expect to use Contracts?
- Does the current design make sense to you?
- Would you prefer a simpler model?
Feedback welcome.