Boost.Decimal: IEEE 754 Decimal Floating Point for C++ — Header-Only, Constexpr, C++14
https://www.boost.org/library/latest/decimal/
https://redd.it/1stha9t
@r_cpp
https://www.boost.org/library/latest/decimal/
https://redd.it/1stha9t
@r_cpp
www.boost.org
Boost.Decimal (1.91.0)
An implementation of IEEE754 Decimal Floating Point Numbers.
Libraries for general purpose 2D/3D geometry vocabulary types?
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 API
`Size`: A wrapper around a `Vector` with size semantics
`AxisAlignedBox`: A set of `Range`s in N dimensions
`Polyline`: A `std::vector<Point>` assumed to be open
`Matrix`: An NxM matrix
...
I 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?
https://redd.it/1stif6d
@r_cpp
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 API
Point: A wrapper around a Vector with point semantics`Size`: A wrapper around a `Vector` with size semantics
Range: A basic min/max interval`AxisAlignedBox`: A set of `Range`s in N dimensions
RotatedBox: A AxisAlignedBox with a basis Vector`Polyline`: A `std::vector<Point>` assumed to be open
Polygon: A std::vector<Point> assumed to be closed`Matrix`: An NxM matrix
...
I 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?
https://redd.it/1stif6d
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
Good Resource for Topics
Hi,
Please suggest good resource for Multithreading, Smart Pointers and Copy Constructor.
Thanks
https://redd.it/1stj0ka
@r_cpp
Hi,
Please suggest good resource for Multithreading, Smart Pointers and Copy Constructor.
Thanks
https://redd.it/1stj0ka
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
Can AI write truly optimized C++?
https://pvs-studio.com/en/blog/posts/cpp/1366/
https://redd.it/1stiofv
@r_cpp
https://pvs-studio.com/en/blog/posts/cpp/1366/
https://redd.it/1stiofv
@r_cpp
PVS-Studio
Let′s check vibe code that acts like optimized C++ one but is actually a mess
The value of a skilled developer is shifting toward the ability to effectively review code. Although generating code now is easier than ever, evaluating it for proper decomposition, correctness...
Devirtualization and Static Polymorphism
https://david.alvarezrosa.com/posts/devirtualization-and-static-polymorphism/
https://redd.it/1sto3hp
@r_cpp
https://david.alvarezrosa.com/posts/devirtualization-and-static-polymorphism/
https://redd.it/1sto3hp
@r_cpp
David Álvarez Rosa | Personal Website
Devirtualization and Static Polymorphism | David Álvarez Rosa | Personal Website
Ever wondered why your “clean” polymorphic design underperforms in benchmarks? Virtual dispatch enables polymorphism, but it comes with hidden …
C++26: Structured Bindings can introduce a Pack
https://www.sandordargo.com/blog/2026/04/22/cpp26-structured-bindings-packs
https://redd.it/1su6ipi
@r_cpp
https://www.sandordargo.com/blog/2026/04/22/cpp26-structured-bindings-packs
https://redd.it/1su6ipi
@r_cpp
Sandor Dargo’s Blog
C++26: Structured Bindings can introduce a Pack
Last week, we talked about how C++26 improves structured bindings by allowing them to be used in conditionals’ init statements. We also briefly touched on other improvements coming in C++26, such as individual binding annotations and constexpr bindings. There…
Hunting a Windows ARM crash through Rust, C, and a Build-System configurations
https://autoexplore.medium.com/hunting-a-windows-arm-crash-through-rust-c-and-a-build-system-configurations-f768dd66d5c5
https://redd.it/1sucxti
@r_cpp
https://autoexplore.medium.com/hunting-a-windows-arm-crash-through-rust-c-and-a-build-system-configurations-f768dd66d5c5
https://redd.it/1sucxti
@r_cpp
Medium
Hunting a Windows ARM crash through Rust, C, and a Build-System configurations
A routine allocator update turned into one of the most interesting debugging sessions I’ve had in a while.
Parallel C++ for Scientific Applications: Integrating C++ and Python
https://www.youtube.com/watch?v=qlLgtSCw0ZA
https://redd.it/1suiegc
@r_cpp
https://www.youtube.com/watch?v=qlLgtSCw0ZA
https://redd.it/1suiegc
@r_cpp
YouTube
CSC4700-Integrating C++ and Python
This lecture discusses integrating C++ and Python. It explains how to combine the user-friendliness and extensive libraries of Python with the performance of C++, focusing on the Pybind11 library as a lightweight and efficient solution for creating Python…
Maintaining libraries in multiple formats are a bad idea
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.
https://redd.it/1sufvwe
@r_cpp
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.
https://redd.it/1sufvwe
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
CppCast Looking for Guests
As you may be aware - I've restarted [CppCast](https://cppcast.com/) (every 4th week in a rhythm with [C++Weekly](https://www.youtube.com/@cppweekly)) 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:
* please don't be offended if I don't respond to your post, I have a very busy travel and conference schedule coming up (I'll see you at an upcoming conference!)
* if you're interested please pay attention for a DM so we can get the conversation started.
* being only 1 podcast per month, we don't need a ton of guests, and it might be a few months before your specific interview gets aired
Thank you everyone!
https://redd.it/1suls4e
@r_cpp
As you may be aware - I've restarted [CppCast](https://cppcast.com/) (every 4th week in a rhythm with [C++Weekly](https://www.youtube.com/@cppweekly)) 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:
* please don't be offended if I don't respond to your post, I have a very busy travel and conference schedule coming up (I'll see you at an upcoming conference!)
* if you're interested please pay attention for a DM so we can get the conversation started.
* being only 1 podcast per month, we don't need a ton of guests, and it might be a few months before your specific interview gets aired
Thank you everyone!
https://redd.it/1suls4e
@r_cpp
Cppcast
Home
Defending against exceptions in a scope_exit RAII type
https://devblogs.microsoft.com/oldnewthing/20260424-00/?p=112266
https://redd.it/1sv03wx
@r_cpp
https://devblogs.microsoft.com/oldnewthing/20260424-00/?p=112266
https://redd.it/1sv03wx
@r_cpp
Microsoft News
Defending against exceptions in a scope_exit RAII type
But maybe it's not worth it.
Using Reflection For Parsing Command Line Arguments
I've been very excited about reflection so I built a small library to pass command line arguments
Basic example:
struct Args
{
std::string firstname;
int age;
bool active;
};
// ./program --first-name John --age 99 --active
const auto args = clap::parse<Args>(argc, argv);
assert(args.firstname == "John");
assert(args.age == 99);
assert(args.active);
More interesting example:
struct Args
{
[= clap::Description<"host to connecto to">{}]
std::string host = "localhost";
[=clap::ShortName<'p'>{}]
std::uint16t port;
[[=clap::Env<"RETRYCOUNT">{}]]
std::uint32t retrycount;
std::optional<std::string> logfile;
[[=clap::ShortName<'e'>{}]]
bool encrypted;
[[=clap::ShortName<'c'>{}]]
bool compressed;
[[=clap::ShortName<'h'>{}]]
bool hashed;
};
// ./program -p 8080 -ec
const auto args = clap::parse<Args>(argc, argv);
assert(args.host == "localhost");
assert(args.port == 8080);
assert(args.retrycount == std::stoul(std::getenv("RETRYCOUNT")));
assert(!args.logfile);
assert(args.encrypted);
assert(args.compressed);
assert(!args.hashed);
The amount of code to handle this is actually quite minimal < 500 lines.
There's a few modern goodies that make this code work:
Reflection \[[P2996](https://isocpp.org/files/papers/P2996R13.html)\]
Annotations for Reflection [P3394\]
Contracts \[[P2900](https://isocpp.org/files/papers/P2900R14.pdf)\]
constexpr exceptions [P3068\]
I guess we don't know what "idiomatic" reflection usage is like yet, I'm interested to come back to this code in a years time and see what mistakes I made!
Link to the code: https://github.com/nathan-baggs/clap
Any feedback, queries, questions are welcome!
https://redd.it/1sv4w78
@r_cpp
I've been very excited about reflection so I built a small library to pass command line arguments
Basic example:
struct Args
{
std::string firstname;
int age;
bool active;
};
// ./program --first-name John --age 99 --active
const auto args = clap::parse<Args>(argc, argv);
assert(args.firstname == "John");
assert(args.age == 99);
assert(args.active);
More interesting example:
struct Args
{
[= clap::Description<"host to connecto to">{}]
std::string host = "localhost";
[=clap::ShortName<'p'>{}]
std::uint16t port;
[[=clap::Env<"RETRYCOUNT">{}]]
std::uint32t retrycount;
std::optional<std::string> logfile;
[[=clap::ShortName<'e'>{}]]
bool encrypted;
[[=clap::ShortName<'c'>{}]]
bool compressed;
[[=clap::ShortName<'h'>{}]]
bool hashed;
};
// ./program -p 8080 -ec
const auto args = clap::parse<Args>(argc, argv);
assert(args.host == "localhost");
assert(args.port == 8080);
assert(args.retrycount == std::stoul(std::getenv("RETRYCOUNT")));
assert(!args.logfile);
assert(args.encrypted);
assert(args.compressed);
assert(!args.hashed);
The amount of code to handle this is actually quite minimal < 500 lines.
There's a few modern goodies that make this code work:
Reflection \[[P2996](https://isocpp.org/files/papers/P2996R13.html)\]
Annotations for Reflection [P3394\]
Contracts \[[P2900](https://isocpp.org/files/papers/P2900R14.pdf)\]
constexpr exceptions [P3068\]
I guess we don't know what "idiomatic" reflection usage is like yet, I'm interested to come back to this code in a years time and see what mistakes I made!
Link to the code: https://github.com/nathan-baggs/clap
Any feedback, queries, questions are welcome!
https://redd.it/1sv4w78
@r_cpp
StockholmCpp 0x3D: Intro, Eventhost, Info and the C++ Quiz
https://youtu.be/i9LQS0QvWpw
https://redd.it/1sv5wtm
@r_cpp
https://youtu.be/i9LQS0QvWpw
https://redd.it/1sv5wtm
@r_cpp
YouTube
StockholmCpp 0x3D: Intro, Eventhost, Info and the C++ Quiz
The intro, and the C++ Quiz from the StockholmCpp 0x3D Meetup.
This event was kindly hosted by NetInsight: https://netinsight.net/
Eventpage: https://www.meetup.com/stockholmcpp/events/314211023/
More info about world of C++ on https://swedencpp.se
This event was kindly hosted by NetInsight: https://netinsight.net/
Eventpage: https://www.meetup.com/stockholmcpp/events/314211023/
More info about world of C++ on https://swedencpp.se