Skip to content

Blog

mp-units 2.5.0 released

A new product version can be obtained from GitHub and Conan.

I initially had different plans for this release, but during development it turned out that the new big feature I was working on was too big and will require some breaking changes. This put me off tracks, and unfortunately the mp-units development slowed down recently 😞

It also turned out that I got unemployed, so now I depend solely on my C++ trainer's career to earn money for living. Fortunately, I delivered many in-house C++ trainings to my customers this year, and I hope this will also be the case for the upcoming 2026. I was also busy with preparations of new talks and classes for this year's C++ conferences.

Having that much on my plate, a break from mp-units was needed to not burn out on the way. But hopefully I am back now and I plan to continue working on long awaited features now.

Said that, if you care about mp-units and would like to see it grow faster, please either contribute or consider sponsoring my work.

This release contains a lot of small patches and improvements.

This post describes the most significant changes while a much longer list of the changes introduced by the new version can be found in our Release Notes.

Introducing Absolute Quantities

An absolute quantity represents an absolute amount of a physical property — measured from a true, physically meaningful zero. Examples include mass in kilograms, temperature in Kelvin, or length in meters (as a size, not a position). Such quantities live on a ratio scale and have a well-defined origin; negative values are typically meaningless.

Absolute quantities stand in contrast to:

  • Affine points (e.g., \(20\ \mathrm{°C}\), \(100\ \mathrm{m}\ \mathrm{AMSL}\)) — values measured relative to an arbitrary or conventional origin.
  • Deltas (e.g., \(10\ \mathrm{K}\), \(–5\ \mathrm{kg}\)) — differences between two values.

Arithmetic on absolute quantities behaves like ordinary algebra: addition, subtraction, and scaling are well-defined and map naturally to physical reasoning. This article proposes making absolute quantities the default abstraction in mp-units V3, reflecting how scientists express equations in practice.


Note: Revised October 31 2025 for clarity, accuracy, and completeness.

Bringing Quantity-Safety To The Next Level

All quantities and units libraries need to be unit-safe. Most of the libraries on the market do this correctly. Some of them are also dimension-safe, which adds another level of protection for their users.

mp-units is probably the only library on the market that additionally is quantity-safe. This gives a new quality and possibilities. I've described the major idea behind it, implementation details, and benefits to the users in the series of posts about the International System of Quantities.

However, this is only the beginning. We've always planned more and worked on the extensions in our free time. In this post, I will describe:

  • What a quantity character is?
  • The importance of using proper representation types for the quantities.
  • The power of providing character-specific operations for the quantities.
  • Discuss implementation challenges and possible solutions.

mp-units 2.4.0 Released

A new product version can be obtained from GitHub and Conan.

This release was unexpected. We planned a significant new feature to happen next, but while preparing for it and writing API Reference documentation, we made so many vital fixes and improvements that we decided they deserve a dedicated release first.

This post describes the most significant improvements while a much longer list of the changes introduced by the new version can be found in our Release Notes.

International System of Quantities (ISQ): Part 5 - Benefits

In the previous articles, we introduced the International System of Quantities, described how we can model and implement it in a programming language, and presented the issues of software that does not use such abstraction to implement a units library.

Some of the issues raised in Part 2 of our series were addressed in Part 3 already. This article will present how our ISQ model elegantly addresses the remaining problems.

International System of Quantities (ISQ): Part 3 - Modeling ISQ

The physical units libraries on the market typically only focus on modeling one or more systems of units. However, as we have learned, this is not the only system kind to model. Another, and maybe even more important, is a system of quantities. The most important example here is the International System of Quantities (ISQ) defined by ISO/IEC 80000.

This article continues our series about the International System of Quantities. This time, we will learn about the main ideas behind the ISQ and describe how it can be modelled in a programming language.