---
title: "Let the Compiler Check Your Units"
url: https://daily.dev/posts/let-the-compiler-check-your-units-mvq43jccy
source_url: https://accu.org/journals/overload/34/192/wu
type: article
source: "C++"
published: 2026-05-22T23:12:24.555Z
updated: 2026-05-22T23:13:05.216Z
tags: ["c++"]
reading_time: 21
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Let the Compiler Check Your Units

**[C\+\+](https://daily.dev/sources/isocpp)** · 21 min read · 0 upvotes · 0 comments

## Summary

A survey of C++ unit libraries that use the type system to enforce dimensional correctness at compile time with zero runtime overhead. Covers user-defined literals (UDLs) and their limitations, then compares four libraries: PhysUnits-CT-Cpp11, SI, Au, and mp-units. Au (C++14+) is highlighted as a practical, lightweight choice using arithmetic composition with unit constants, while mp-units (C++20+) is the most feature-complete and serves as the basis for the upcoming C++ standard proposal P3045, targeting C++29. Key concepts include dimensional analysis, quantity kinds (distinguishing semantically different quantities with the same dimension), QuantityPoint vs Quantity (mirroring chrono's time_point/duration), and safe implicit conversion rules. The article also previews the ongoing standardization effort to add physical units to the C++ standard library.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://accu.org/journals/overload/34/192/wu>

## Similar posts on daily.dev

- [KCL part 1: units](https://daily.dev/posts/kcl-part-1-units-5mbl59eew) · Nick Cameron · 0 upvotes · 0 comments

---

Tags: [#c++](https://daily.dev/tags/c++)

[View this post on daily.dev](https://daily.dev/posts/let-the-compiler-check-your-units-mvq43jccy)
