StockholmCpp 0x3D: Intro, Eventhost, Info and the C++ Quiz
youtu.beThe intro of the most recent Stockholm Cpp Meetup, with a short overview of what NetInsight develops with C++, some news about C++, and the C++ Quiz
The intro of the most recent Stockholm Cpp Meetup, with a short overview of what NetInsight develops with C++, some news about C++, and the C++ Quiz
r/cpp • u/lefticus • Apr 24 '26
As you may be aware - I've restarted CppCast (every 4th week in a rhythm with C++Weekly) with u/mropert as my cohost.
We are trying to focus on new people and projects who have never before been on CppCast. I have been trolling the show and tell posts here for potential guests and projects.
But I want to ask directly - if you are interested in coming on the podcast to talk about your project / presentation / things you are passionate about and have never before been on CppCast, please comment!
A couple of notes:
Thank you everyone!
r/cpp • u/emilios_tassios • Apr 24 '26
In this week’s lecture, Dr. Hartmut Kaiser focuses on the seamless integration of C++ and Python. The lecture highlights essential foundational concepts by exploring how to combine the user-friendliness and extensive library ecosystem of Python with the raw performance of C++, setting the stage for highly efficient scientific computing.
A core discussion demonstrates how to utilize the Pybind11 library as a lightweight solution for creating Python bindings, specifically addressing the practical challenges of mapping C++ functions, classes, and diverse data types. Finally, critical strategies for integrating NumPy arrays are explored, offering a comprehensive approach to maximizing performance in advanced mathematical and data-driven applications.
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/TheHPXProject/hpx
r/cpp • u/pavel_v • Apr 24 '26
r/cpp • u/ravenrandomz • Apr 25 '26
Every now and then, someone asks how C++ modules are going. I am a lead dev (mentioned not for bragging but to emphasize the crushing weight of responsibility) for a robotics project, as we are making a CV codebase from scratch, I have the opportunity to choose the architecture and conventions of the code (even more crushing responsibility).
I have gotten some C++23 codebases with modules set up; however, whenever adding a new module, I have to recompile to get clangd to not spam extra errors. I have been starting to get second thoughts with pushing modules all the way. To avoid the gcc-clangd stuff, I ended up specifying the compiler as clang (although I could use clangd compiler flag remove/add).
The codebase is at a point where I can relatively, easily pull the plug on modules.
Requirements:
Ideals:
Why (for the curious):
For the curiouser: no, we don't use github anymore :P
r/cpp • u/Havunenreddit • Apr 24 '26
This week I experienced really interesting bug hunt where Windows ARM target platform started failing CI while other environments passed successfully.
I learnt how to:
Hope you like it :)
r/cpp • u/david-alvarez-rosa • Apr 23 '26
r/cpp • u/boostlibs • Apr 23 '26
Boost 1.91 ships a new library: Boost.Decimal, a full implementation of IEEE 754 and ISO/IEC DTR 24733 decimal floating point types. Authors are Matt Borland and Chris Kormanyos.
The problem it solves
Binary floating point stores significands in base-2. This means values like 0.1 can't be represented exactly, which is why 0.1 + 0.2 != 0.3 in every language that uses IEEE 754 binary FP. Decimal floating point stores significands in base-10, eliminating these representation errors entirely. If you've ever used integer arithmetic or fixed point to avoid rounding issues in financial code, this is the general purpose alternative.
What you get
Six types across two families. The IEEE-conformant types, decimal32_t, decimal64_t, decimal128_t, give you strict standards compliance. The non-IEEE fast variants, decimal_fast32_t, decimal_fast64_t, decimal_fast128_t, trade strict conformance for throughput, and benchmark significantly faster (often 2–3x over the IEEE types for basic arithmetic).
Nearly everything is constexpr, thanks to a deliberate design decision to target C++14's relaxed constexpr rather than support floating point exception flags. The library treats decimal types as close to built in types as possible.
Standard library surface coverage is extensive: <cmath> (trig, exp, power, error/gamma, special functions), <charconv> (to/from_chars), <format> and {fmt}, <cfenv> rounding modes, <cfloat> eval modes, <cstdio> printf, <functional> hash, <limits> numeric_limits, and <string> to_string. Boost.Math integration works out of the box, giving you statistics, interpolation, and quadrature on decimal types for free.
Performance
This is software FP competing against hardware-accelerated binary FP, so basic arithmetic is naturally slower, typically 10–30x vs double for the IEEE types, and 4–15x for the fast types. But <charconv> is where things get interesting: from_chars for decimal32_t runs at roughly 1.2× vs double on Linux, and on MSVC it's actually ~5× faster than double. to_chars in scientific format at 6-digit precision comes in under double across all platforms. The fast types also consistently outperform Intel's libbid and GCC's _Decimal types in most benchmarks.
Practical details
Header only, no dependencies, requires C++14. Tested on x86_64, ARM64 (including Apple Silicon), s390x, PPC64LE, and ARM Cortex-M (via QEMU). Compiler support: GCC 8+, Clang 6+, MSVC 2019+, Intel oneAPI DPC++.
One design trade off worth noting: <cmath> functions are not correctly rounded in the IEEE 754 sense (0.5 ULP). This matches real-world behavior from Intel's own libdfp, and is consistent with how binary FP math libraries work in practice. The authors chose constexpr support over FP exception flags, which seems like the right call for a modern C++ library.
Docs: https://boost.org/libs/decimal
Benchmarks: https://boost.org/doc/libs/latest/libs/decimal/doc/html/benchmarks.html
Happy to answer questions. We would be interested to hear from anyone doing financial or embedded work on whether this changes how you'd approach precision sensitive code.
r/cpp • u/parkotron • Apr 23 '26
I work in the geospatial industry and have worked on plenty of large projects that have their own internal geometry libraries. Some good, some bad, most with interesting historical choices. I recently joined a new project that hasn't yet really defined its vocabulary types yet, and I'm finding that extremely inconvenient, so I'm looking around at what is common
The kinds of things I'm looking for are:
Vector<typename T, size_t Dimension>: Basically a std::array<T,Dimension> with a vector-like APIPoint: A wrapper around a Vector with point semanticsSize: A wrapper around a Vector with size semanticsRange: A basic min/max intervalAxisAlignedBox: A set of Ranges in N dimensionsRotatedBox: A AxisAlignedBox with a basis VectorPolyline: A std::vector<Point> assumed to be openPolygon: A std::vector<Point> assumed to be closedMatrix: An NxM matrixI know there are plenty of vector/matrix/linear algebra libraries out there, often focused on flexibilty and raw computational performance. I'm more interested in nice vocabulary types that implement proper semantics via convenient methods and operators.
It seems these things are often provided by game engines, but pulling in an entire game engine for a non-gaming project feels silly.
So if you were starting a new, greenfield C++ application dealing with 3D geometric data, which existing library, if any, would you reach for?
r/cpp • u/TheRavagerSw • Apr 24 '26
Library authors shouldn't maintain header only/ header source/ module libraries in one repo. It is a bad idea.
First of all library authors assume if tests succeed on header only format it also works on modules, which is not correct.
Second, the compilation and packaging becomes very ugly, it looks similar to c++ standard versioning macros. Like a project should only compile on one standard, and the other users should either stick to a version/branch or kick rocks.
It is very pleasant to just use modules for libraries, everything is clean. By adopting a support everything approach, library authors harm themselves first and then everyone else because everything lags down.
r/cpp • u/boostlibs • Apr 22 '26
Boost 1.91 is out. Here's a rundown of what's notable.
New Library
Boost.Decimal: A full IEEE 754 / ISO 24733 implementation of decimal floating point types (decimal32_t, decimal64_t, decimal128_t) plus non-conformant fast variants. Significands stored in base-10, so 0.1 + 0.2 actually equals 0.3. Header only, no dependencies, C++14. Comes with <cmath>, <charconv>, <format>, rounding mode, and numeric_limits support out of the box. If you've been using integer arithmetic or fixed-point to dodge binary FP in finance or embedded, it's worth a look. Authors: Matt Borland and Chris Kormanyos.
Highlights from Updated Libraries
Full release notes: https://www.boost.org/releases/1.91.0/
r/cpp
•
u/patteliu
•
Apr 22 '26
Writing gRPC Clients and Servers with C++20 Coroutines
gRPC's asynchronous interface is quite complex, especially for servers that need to support concurrency. So how can we combine it with coroutines to write simple and easy-to-understand code?
Please read the blog for implementation details; here we are only showing the final code.
Protocol:
syntax = "proto3";
package sample;
service SampleService {
// Unary RPC: simplest request-response pattern
rpc Echo(EchoRequest) returns (EchoResponse);
// Server streaming: server continuously pushes data to the client
rpc GetNumbers(GetNumbersRequest) returns (stream Number);
// Client streaming: client continuously sends data, server returns one result
rpc Sum(stream Number) returns (SumResponse);
// Bidirectional streaming: both sides can send and receive continuously
rpc Chat(stream ChatMessage) returns (stream ChatMessage);
}
message EchoRequest { string message = 1; }
message EchoResponse { string message = 1; int64 timestamp = 2; }
message GetNumbersRequest { int32 value = 1; int32 count = 2; }
message Number { int32 value = 1; }
message SumResponse { int32 total = 1; int32 count = 2; }
message ChatMessage { string user = 1; string content = 2; int64 timestamp = 3; }
Client:
;
asyncio::task::Task<void>
Server:
;
asyncio::task::Task<void>
Because some people complained that it was too long, I reposted it on my own blog.
r/cpp • u/meetingcpp • Apr 22 '26
Heyaa,
So recently I had to compare binaries in the layout of multi level nested big fat structures. I surprised to find that there are no good tools to do that. The best i could find was watch section in visual studio. I have tried another tool, WinDbg this doesn’t work well with macros and arrays. To make matters worse, this big ass structure has offsets that point beyond of the structure. There is no good tools which automatically tells values for each field
Tldr: i have custom buffer layout with multiple nested level structures.
r/cpp • u/pavel_v • Apr 21 '26
r/cpp • u/tartaruga232 • Apr 22 '26
Compares defining a member function in an external partition, versus defining it in a separate cpp file. With real code examples from our UML Editor.
This mailing has 4 N-papers and 161 P-papers. The disposition column shows the final papers adopted for C++26 in Croydon (they are marked Adopted 2026-03).
For those writing papers, 3 weeks until the pre-Brno mailing...
r/cpp • u/tartaruga232 • Apr 21 '26
This blog posting from me about C++ modules explains in detail what causes unneeded recompilations using detailed code examples from the sources of our UML Editor.
It's a precise description and a showcase of what's the status quo in the C++ standard.
Quote from the posting:
The C++ language currently lacks a concise and easy to use alternative for explicitly expressing the minimally required dependencies on partitions.
(Note: All code examples shown or linked from the text are 100% standard conformant.)
Thanks in advance for comments. Please ask if you do not understand anything or anything is unclear. I would appreciate if you could leave a comment if you don't like anything. Thanks for reading!
r/cpp • u/robwirving • Apr 20 '26
r/cpp • u/claimred • Apr 20 '26
Refreshing take by Herb. Slides here
r/cpp • u/ProgrammingArchive • Apr 20 '26
CppCon
2026-04-13 - 2026-04-19
2026-04-06 - 2026-04-12
2026-03-30 - 2026-04-05
C++Online
2026-04-13 - 2026-04-19
2026-04-06 - 2026-04-12
2026-03-30 - 2026-04-05
ADC
2026-04-13 - 2026-04-19
2026-04-06 - 2026-04-12
2026-03-30 - 2026-04-05
Meeting C++
2026-04-06 - 2026-04-12
2026-03-30 - 2026-04-05
using std::cpp
2026-03-30 - 2026-04-05
r/cpp • u/KijoSenzo • Apr 20 '26
I know Python and have been binging C++ for a couple of days now from scratch. C++ feels like a language where you gradually discover a huge checklist of "STATE YOUR INTENT" due to years of probably layering on things to shore up its weaknesses of memory/type safety etc. Like I get it, it's how C++ was designed for things to be explicit and it's like the English language where you don't need to know every word and in this case, feature, but every line of code makes me feel I'm asking a gajillion questions.
So far I have jotted down some stuff that took me awhile to digest...
So I guess I'm not very familiar with the ecosystem or ever worked with other C++ code. Like is this good or bad? I would think it's very safe but do and should people code actually C++ like this? I don't have a frame of reference to relate to and I don't know if the C++ community is going to jump on things like C++26's contracts or reject it. What's the current attitude? If you were a teammate, would you love or hate to see something like this?
[[nodiscard]] constexpr std::expected<int, Error> GetHP(const std::unique_ptr<Player>& player)
{
assert(player);
if (!player) return std::unexpected(Error::NullPlayer);
const auto [hp, alive] = std::pair{player->hp, player->hp > 0};
static_assert(sizeof(int) == 4);
return alive ? hp : 0;
}