r/cpp • u/jishnu_periya • 43m ago
Anyone want to improve c++ together?
I am thinking of creating a small group for people who want to improve their c++ skills. Anyone interested,?
r/cpp • u/jishnu_periya • 43m ago
I am thinking of creating a small group for people who want to improve their c++ skills. Anyone interested,?
Earlier this year, Clang added basic support for building simple programs that use Clang modules or C++20 modules directly from the Clang driver, without an external build system. This includes using the std/std.compat modules: https://godbolt.org/z/sahYMsxna
The documentation landed yesterday (although the feature is already in Clang 23), so I thought I would advertise it here now: https://clang.llvm.org/docs/StandardCPlusPlusModules.html#compiling-modules-using-the-clang-modules-driver
This is still a very experimental feature, and it doesn't support caching yet. Currently, all modules used are recompiled on each invocation, which is especially painful with the large C++ Standard library modules.
The main purpose of this isn't to compete with dedicated build systems such as CMake, but to make modules more accessible. I hope this makes it easier to use modules in smaller examples, and maybe even in some people's first Hello World programs.
(This was part of a GSoC project I did in 2025. Happy to answer any questions!)
r/cpp • u/johnnyfedavo • 10h ago
I've been using C++ for a couple years and I can't stand the standard library anymore. To me it's a mess of headers and classes. It's jammed with repeating features but in different formats, such as std::print, modules, and other stuff from C that are just in the C++ format. Don't get me started on strings, I've encountered at least 10 different ways of handling strings in different libraries and it's a hastle to convert between each of them. Am I the only one that hates it? If so please correct me and tell me on how to properly love it.
Also, would it be crazy to write my own, simpler, version of the STD library for my own projects?
r/cpp • u/marzer8789 • 2d ago
Hiya folks,
I've finally come back to maintaining toml++ after a couple of years focusing on other things, and am happy to share that v3.5.1 is now released! Highlights since v3.4.0:
std::chrono date-time typesimport tomlplusplusFull changelog here.
"What about v3.5.0?"
3.5.0 and 3.5.1 are exactly the same library. The patch bump was necessary because I'm rusty and messed up the tagging for v3.5.0, so I just made a new release right on top of it to keep things safe for packaging systems.
Also this will probably the last feature bump for the v3.x series of releases. There's a whole load of larger structural and design things I want to get to that require breaking changes, so I'll start cooking on those and hopefully have that out as a v4 next year some time. Until then it'll just be patch bumps.
r/cpp • u/SignalDepth6131 • 3d ago
I wrote up a short report from the BĂșzios meeting and where things stand with C++26:
https://cppalliance.org/newsmedia/news/b%C3%BAzios-trip-report-what-the-c26-ballot-taught-us/
I've been optimizing startup times on my project lately. Some of it came down to file I/O and some bits of the standard library I consider to be potential traps. Here's a writeup.
r/cpp • u/horsey_jumpy • 4d ago
Since there's no kalshi market for c++ standards, put your predictions below for the upcoming second dis.
r/cpp • u/Foxi_Foxa • 4d ago
Dear Boost.Graph community,
Starting with Boost 1.93, you will be able to pass stateful visitors with std::ref :
Counter vis;
boost::depth_first_search(g, boost::visitor(std::ref(vis)));
// vis.count is now up to dateFor context, BGL visitors are small structures with event methods that are fired at specific points of an algorithm (e.g. the DFS algorithm calling vis.start_vertex(vertex, graph) at a certain point). Most visitors are meant to be pure observers and their events return void so they can't influence the execution flow of their algorithm. If a visitor only prints data, stateless is fine. But when wanting an answer out of a traversal (a yes/no, timestamps, paths...), it has to accumulate state.
Historically, algorithms implementation (circa 2000) predate std::ref (C++11). Any state stored in the visitor was therefore updated on a copy and lost. The recommended approach was to capture state through pointer or reference. But a reference member contradicts Core Guideline C.12 and triggers clang-tidy's cppcoreguidelines-avoid-const-or-ref-data-members, as reported by a redditor: https://www.reddit.com/r/cpp_questions/comments/1oj6mi6/boost_graph_library_example_seems_to_run_afoul_of/
From 1.93, algorithms will be able to unwrap visitors when the caller passed a reference_wrapper. It's an extension, you don't need to modify your existing code if it works. But if you want to silence the clang-tidy once for all, you now can đ
Four exceptions to this: we had 4 planar algorithms that surprisingly took visitors by reference, against this convention, and needed to be deprecated to harmonize their signatures:
- planar_face_traversal,
- make_connected,
- make_biconnected_planar
- make_maximal_planar
In 1.93, your calls still compile and behave the same, but they now emit a deprecation warning, and the old overloads are planned for removal in Boost 1.95. The replacements live in boost::graph namespace (we are harmonizing namespaces progressively too)
boost::make_connected(g, vm, vis); // still works, deprecated
boost::graph::make_connected(g, vm, std::ref(vis)); // replacementAll details, explanations and rational live in the dedicated Github Discussion: https://github.com/boostorg/graph/discussions/700
See you there ! đ„ł
r/cpp • u/ProgrammingArchive • 4d ago
C++Now
2026-11-16 - 2026-11-22
2026-11-09 - 2026-11-15
2026-11-02 - 2026-11-08
2026-10-26 - 2026-11-01
ACCU
2026-11-16 - 2026-11-22
2026-11-09 - 2026-11-15
2026-11-02 - 2026-11-08
2026-10-26 - 2026-11-01
CppCon
2026-11-16 - 2026-11-22
2026-11-09 - 2026-11-15
ADC
2026-11-16 - 2026-11-22
2026-11-09 - 2026-11-15
2026-11-02 - 2026-11-08
2026-10-26 - 2026-11-01
r/cpp • u/grishavanika • 5d ago
From P4451R2,
#include <contracts>
int f(int x)
pre<std::contracts::controls::enforced>(x > 0)
post<std::contracts::controls::enforced>(r : r > 0)
{
contract_assert<std::contracts::controls::enforced>(x > 0);
return x;
}
Long, 3 levels deep namespace? And
Because the label is found by ordinary name lookup, a namespace alias or a using-directive works
as well:
namespace scl = std::contracts::controls;
Same issue as with C++11 UDL: inconvinient to use, especially in headers, since include + alias is required - aliases will not make it better, in my opinion.
That makes me sad. Am I the only one?
r/cpp • u/Expert_Sheepherder24 • 4d ago
//math.ixx
module;
#include <vector>
export module math;
//nothing is exported
//main.cpp Vs2026 18.9.2
import math;
int main()
{
std::vector<char> value = { 'a', 'b', 'c'}; // OK, but why?
return 0;
}r/cpp • u/ThadeeusMaximus • 5d ago
It seems like every update to MSVC over the past year has had some sort of massive basic compiler regression, that the team refuses to actually hotfix because regressions are not actually considered problematic. What can we do to change this and actually make regressions fixable without waiting 6+ months? Having "LTS" compilers isn't useful when every LTS compiler has some break in it.
Using older compilers isn't an option, because we're an open source library that people use, and also GitHub Action runners automatically update to the newest compilers and don't make it easy to use old ones.
This is our new one from this time.
Some casual chat about recent developments in C++
Herb's usual trip report
r/cpp • u/GodRishUniverse • 5d ago
Meson and Bazel exist but I have not seen widespread adoptability.
Edit: I forgot to add package manager in title as well lmao
So the REBASE'26 conference happened recently, and besides the whole thing of what Carbon has achieved or never will, there are talks like this one from Google folks, regarding what they are doing with their C++.
The talk is all about the recent ongoing migration discussed on Google security blog, and other related efforts.
r/cpp • u/LegalizeAdulthood • 8d ago
Utah C++ Programmers has released a new video.
Your CI runners have better things to do than compile the same dependencies again. Learn how to put them on the fast track with vcpkg-github-cache, a GitHub Action that connects vcpkg binary caching to GitHub Packages.
We'll go beneath the workflow YAML to explore how NuGet packages store compiled dependencies, how vcpkg restores them, and how to manage a cache across multiple open source projects. Along the way, we'll tackle authentication, package visibility, repository permissions, and cache diagnostics. Leave ready to turn repeated compilation into reusable binaries and give your C++ builds a head start.
r/cpp • u/ProgrammingArchive • 11d ago
C++Now
2026-11-09 - 2026-11-15
2026-11-02 - 2026-11-08
2026-10-26 - 2026-11-01
ACCU
2026-11-09 - 2026-11-15
2026-11-02 - 2026-11-08
2026-10-26 - 2026-11-01
ADC
2026-11-09 - 2026-11-15
2026-11-02 - 2026-11-08
2026-10-26 - 2026-11-01
r/cpp • u/Proper_Meaning7756 • 12d ago
At work, I write real time software. Seeing where allocations happen and having guarantees on the behaviour of code would be nice. Compile times can be much faster and optimisations can also be aggressive when you know you're restricted to a subset of the language.
r/cpp • u/madnirua • 11d ago
and also with WASM and iOS support for C++ users. Thanks to all the 51 contributors for making this release happen.
r/cpp • u/ykiko_2005 • 12d ago
Hi r/cpp! I've been working on clice, a C++ language server built on Clang, for about two and a half years, and 1.0 is out today. The main differences from clangd:
The post covers the features and the story behind it. Binaries for Linux, macOS and Windows (x64 and arm64) are on the release page, and the VS Code extension is on the Marketplace. Feedback and bug reports are very welcome!
Release post: https://ykiko.me/en/articles/2105384023094834022/