Skip to content

v2.0.0

Latest

Choose a tag to compare

@cleishm cleishm released this 10 Jul 19:12
4d29e65

⚠️ Breaking changes

  • millifahrenheit and delta_millifahrenheit counts change meaning by 10×. These types used std::ratio<5, 900> (0.01 °F per count) instead of the documented std::ratio<5, 9000> (0.001 °F per count). The ratio now matches the documentation: temperature_cast<millifahrenheit>(fahrenheit(1)).count() was 100 and is now 1000. Any stored or transmitted raw counts from these two types must be reinterpreted; all other types are unaffected.
  • The celsius_real, kelvin_real, and fahrenheit_real typedefs are removed. They existed mainly as a display workaround, which spec-based rendering (below) covers directly. Migration: replace std::format("{:.1f}", temperature_cast<celsius_real>(x)) with std::format("{:.1f}", x). Generic floating-point rep support remains available via e.g. temperature<celsius_scale, delta<double>>.

What's new

  • All temperature and delta types now honor floating-point format specs, rendering the value in scale degrees: std::format("{:.1f}", millicelsius(22534))"22.5°C", {:.1f} of delta_millifahrenheit(9000)"9.0Δ°F". The empty spec keeps the exact-count form ("22534m°C") unchanged.
  • The 18 hand-written std::formatter specializations and 15 to_string overloads are replaced by two generic templates each, covering every temperature/delta instantiation with byte-identical default output.

Full Changelog: v1.3.0...v2.0.0