A Physical Units Library For the Next C++
summary
mp-units is a header-only C++20 library (release 0.6.0, available on Conan and Compiler Explorer) that encodes units as types to guarantee compile-time safety and human-friendly errors, supports SI/FPS/CGS and custom systems, and uses concepts, class-type NTTPs and quantity_cast for zero-overhead conversions. Benchmarks show fewer instructions than naive double code and often one division instead of extra converts, comparing favorably to Boost.Units and Nick Holthaus’s units. It prints formatted units, works with vector/matrix reps, and targets standardization (GCC10+/MSVC16.7).
AI-written summary · about
chapters (6)
- 0:00Introduction to physical units
- 12:50Strong interfaces in the library
- 27:41Runtime performance comparison
- 39:21Framework basics and concepts
- 53:11C++20 concepts benefits
- 1:01:21Environment compatibility and next steps
related talks
01h 02mA Physical Units Library For C++
01h 31mImplementing Physical Units Library for C++
01h 23mThe Power of C++ Templates With mp-units: Lessons Learned & a New Library Design
01h 30mEnhancing Safety in C++ Code With Modern C++ Quantities and Units Library
01h 03mHow to Improve the Safety of C++ Code With a Quantities & Units Library
01h 40mUsing Units, Qantities, and Dimensions in C++14
55mTaking Static Type-safety to the Next Level: Physical Units for Matrices
01h 03mTaking Static Type-Safety to the Next Level - Physical Units for Matrices
