r/cpp • u/claimred • Apr 20 '26
Software taketh away faster than hardware giveth: Why C++ programmers keep growing fast despite competition, safety, and AI
herbsutter.comRefreshing take by Herb. Slides here
r/cpp • u/claimred • Apr 20 '26
Refreshing take by Herb. Slides here
r/cpp • u/tartaruga232 • Apr 20 '26
I assume Gaby meant that the design of module partitions could be changed, such that the syntax:
// Translation unit #1 (C++29?)
module M:P; // Note: partition P is an external partition of M
...would mean, that in such a TU #1 we could define functions of the module M.
:P.That is, it would be ok to write:
// Translation unit #1 (C++29?)
module M:P;
...
// Translation unit #2 (C++29?)
module M:P;
...TU's #1 and #2 could not be imported (and don't need producing a BMI). That is, they do not introduce a named partition.
These would basically be "unnamed partitions" for implementing modules. They would be analogous to the current "module M;".
Can we go back to the drawing board about partitions?
I think we are going in circles with the idea of anonymous partitions by u/not_a_novel_account.
If we could redefine the syntax "module M:P;" that would solve the problem of unwanted module dependencies. Which is, per the current standard, if I write:
// Translation unit #3 (C++20)
module M; // implicitly imports M
import :P;
...I get :P twice plus the rest of the interface of M (which I don't need in TU #3).
Implications:
(A) We would have to rewrite existing code
// Translation unit #4a (C++20)
module M:P;
...to
// Translation unit #4b (C++29?)
export module M:P;
...and (B) remove the requirement in the current standard that TU #4b must be exported from the primary module interface unit (PMIU), if and only if nothing from TU #4b is exported.
I'm addicted to modules and I won't go back to using header files, but I think the current design of partitions in the standard is a real mess (sorry).
Thoughts?
r/cpp • u/tartaruga232 • Apr 19 '26
What is the reason for implicitly importing the interface of the module when implementing the functions of an internal partition?
r/cpp • u/Sea-Log-8341 • Apr 18 '26
What do you guys think about the book Introducing C++: The Easy Way to Start Learning Modern C++ by Frances Buontempo i was considering to buy it because i want to learn c++ and i already have some experiences coding in other languages it seems like a sort of successor to accellerated c++
r/cpp • u/meetingcpp • Apr 18 '26
I just clicked a link that wasn’t cached and noticed very long loading time. Eventually the page loaded, and I noticed the font was different. After Herb’s post, I was excited and noticed the homepage notice declared the site newly operational again! However I am experiencing a significant number of 5xx errors.
r/cpp • u/Embarrassed_One4431 • Apr 17 '26
r/cpp • u/Xaneris47 • Apr 17 '26
Developers from PVS-Studio are continuing their series of talks about creating a custom programming language. They will explain what the lexer is, what it consists of, and how to work with it.
The talk series as a whole is for devs who want to start understanding how compilers work under the hood. Throughout the series, their C++ architect demonstrates the practical application of each programming language component.
If you're interested, I leave the link here.
r/cpp • u/emilios_tassios • Apr 17 '26
HPX is a general-purpose parallel C++ runtime system for applications of any scale. It implements all of the related facilities as defined by the C++23 Standard. As of this writing, HPX provides the only widely available open-source implementation of the new C++17, C++20, and C++23 parallel algorithms, including a full set of parallel range-based algorithms. Additionally, HPX implements functionalities proposed as part of the ongoing C++ standardization process, such as large parts of the features related parallelism and concurrency as specified by the C++23 Standard, the C++ Concurrency TS, Parallelism TS V2, data-parallel algorithms, executors, and many more. It also extends the existing C++ Standard APIs to the distributed case (e.g., compute clusters) and for heterogeneous systems (e.g., GPUs).
HPX seamlessly enables a new Asynchronous C++ Standard Programming Model that tends to improve the parallel efficiency of our applications and helps reducing complexities usually associated with parallelism and concurrency.
In this video, we explore how to perform deep runtime analysis on HPX applications using APEX and the Traveller visualization tool, detailing how visualizing OTF2 traces helps distinguish between true application performance and redundant computation where raw hardware utilization metrics often prove deceptive. We focus on the configuration of HPX with APEX and the bundling of raw trace files, demonstrating the interpretation of profiling data through a practical comparison of unoptimized odd-even transposition and native HPX parallel sorting algorithms. The tutorial details the process of diagnosing misleading "busy full" scenarios, utilizing Traveller's interactive web panels—including utilization views, interval histograms, and dependency trees—to uncover inefficient task structures and visualize recursive fork-join patterns, ensuring that applications are delivering true algorithmic efficiency rather than just keeping cores busy. This provides a clear introduction to evaluating HPX's lightweight task management, culminating in actionable insights, where we illustrate how to resolve performance flaws and harness the full potential of modern parallel hardware.
If you want to keep up with more news from the Stellar group and watch the lectures of Parallel C++ for Scientific Applications and these tutorials a week earlier please follow our page on LinkedIn https://www.linkedin.com/company/ste-ar-group/ .
Also, you can find our GitHub page below:
https://github.com/STEllAR-GROUP/hpx
https://github.com/STEllAR-GROUP/HPX_Tutorials_Code
r/cpp • u/tartaruga232 • Apr 17 '26
Quick question for those who currently use modules with partitions.
That is, for a module like the one below (our file Core/_Module.ixx):
export module Core;
export import :Attach;
export import :Base;
export import :Container;
export import :Diagram;
export import :Interfaces;
export import :Transaction;
export import :View;How did you implement your code?
What we did:
We have done it as I've described in my blog posting "How a Module Should Look", which is for example for our file Core/Transaction/FinalizerDock.cpp:
module Core;
import :Transaction;
...which contains function definitions for declarations in the partition Core/Transaction/Transaction.ixx:
export module Core:Transaction;
...Please tell me what you did. I'm really curious.
Thanks in advance for the responses!
r/cpp • u/DarkCisum • Apr 16 '26
It's minor version, but with major features.
r/cpp • u/madnirua • Apr 16 '26
r/cpp • u/marcoarena • Apr 16 '26
Hi everyone!
I am organizing a special meetup with Bjarne Stroustrup in Florence on Saturday, May 9!
Schedule:
The event will take place at the University of Florence (Novoli Campus) and is organized by the Italian C++ Community, the University of Florence, and the University of Pisa.
For developers traveling from abroad, this is also a great excuse to visit Florence, while connecting with the Italian C++ community.
Free registration and details:
https://italiancpp-fi26.eventbrite.it/
Looking forward to seeing you there!
r/cpp • u/Krystian-Piekos • Apr 16 '26
How to apply annotations for better generic hash implementation in C++26.
r/cpp • u/igaztanaga • Apr 16 '26
Announced officially in the Boost developer mailing list:
Introduction
The formal review of Joaquín M López Muñoz's boost::container::hub container, for inclusion in the Boost.Container library, starts today.
hub is a sequence container with O(1) insertion and erasure and element stability with great performance (see these benchmarks): pointers/iterators to an element remain valid as long as the element is not erased. hub is very similar but not entirely equivalent to C++26 std::hive (hence the different naming, consult the section "Comparison with std::hive" for details).
It may be downloaded from:
https://github.com/joaquintides/hub
the documentation may be found here:
https://github.com/joaquintides/hub/blob/develop/README.md
Anyone is welcome to post a review and/or take part in subsequent discussions in the mailing list.
Review guidelines
Please provide feedback on the following general topics:
Ensure to explicitly include with your review: ACCEPT, REJECT, or CONDITIONAL ACCEPT (with acceptance conditions).
Ion Gaztañaga (Review Manager)
r/cpp • u/ericbrumer • Apr 15 '26
Hi folks, one of the MSVC dev leads here.
MSVC versioning is confusing, and with the change to decouple MSVC releases from Visual Studio releases (https://aka.ms/msvc/lifecycle) it's confusing-er. This post aims to clarify what's going on with 14.50 & later.
I am intentionally skipping discussion of the VS2022 & older releases that are still being supported since the servicing model is different. Know that our team still supports Visual Studio 2019 16.11 per https://learn.microsoft.com/en-us/visualstudio/releases/2019/servicing-vs2019, and Visual Studio 2022 17.12 & 17.14 as per https://learn.microsoft.com/en-us/visualstudio/releases/2022/servicing-vs2022 .
Since MSVC releases are decoupled from Visual Studio releases, it's helpful to think from the standpoint of the MSVC toolchain. At any point in time, we ship:
As of today, we ship the following MSVC toolsets:
14.52 the preview toolset, built from our development branch last Tuesday (April 7th)14.51 the default toolset, currently a 'release candidate'14.50 the toolset we released in Nov 2025, with 3 years of support.Our plan, as per https://aka.ms/msvc/lifecycle, is to ship a new 14.5* twice a year. So in 6 months we expect to ship 14.53 as the new 'latest preview', make 14.52 the 'current default toolset', and 14.51 will be a toolchain in support as per the support policy, along with 14.50.
Visual Studio 'stable' ships monthly (https://learn.microsoft.com/en-us/visualstudio/releases/2026/release-rhythm), so if you're on the Visual Studio stable channel you'll get monthly updates to all the 14.5* toolsets. To be explicit:
If you want to get MSVC toolset updates far quicker than monthly, switch to the Visual Studio Insiders channel https://visualstudio.microsoft.com/insiders/. Keep an eye on https://learn.microsoft.com/en-us/visualstudio/releases/2026/release-notes-insiders for how often these updates occur.
Want just the far-quicker-than-monthly MSVC build tools and not the full Visual Studio? Use the build tools sku: http://aka.ms/vs/insiders/vs_buildtools.exe
We blogged recently https://devblogs.microsoft.com/cppblog/msvc-build-tools-version-14-51-release-candidate-now-available/ that the default toolset is moving from 14.50 to 14.51. As per https://aka.ms/msvc/lifecycle we aim to ship a new default toolset every 6 months. However, about a month before this lands in the Visual Studio 'Stable' channel we want to land the new default toolset in the 'Insiders' channel. This gives folks using Insiders about a month to give us feedback to fix 14.51 bugs before it shows up for 'Stable' channel users.
When you install Visual Studio (using any channel) and select the Desktop development with C++ workload, you only get the default MSVC toolset.
To install the 'latest preview' you need to run the Visual Studio installer and select the MSVC Build Tools for <arch> (Preview) option, as per https://aka.ms/msvc/preview
To install an older in-support release, you need to run the Visual Studio installer, switch to the 'Individual Components' tab, and find the 14.5* toolset to install. If you are on the Insiders channel, only had the default MSVC toolset chosen, and recently upgraded, you'll see that your 14.50 toolset was replaced with 14.51... add it back in the 'Individual Components' tab.
The biggest benefit of the new model is to vastly shorten the distance between MSVC features and folks using them in a Preview. Folks on the MSVC development team can make a change which ships in the next week or so. This timeframe used to be months, but has now shortened to just a week. Not all C++ users want this, so MSVC Previews are an optional installation component.
Most of the other reasons are called out in https://aka.ms/msvc/lifecycle:
Thanks for reading.
This is not my post, but I didn't see anyone share this here yet.
r/cpp • u/mr_gnusi • Apr 15 '26
When building a vector search for SereneDB [https://github.com/serenedb/serenedb], we benchmarked our distance functions against Faiss. The results were surprising, a plain C++ loop with no intrinsics came out faster. The answer comes down to two compiler flags and one standard library call.
Full write-up with assembly: https://blog.serenedb.com/simd-distances