Skip to content

Releases: cleishm/thermo-cpp

v1.2.1

10 Feb 04:24

Choose a tag to compare

  • Add CONFIG_THERMO_STD_FORMAT flag and Kconfig to allow explicit control over std::format support

v1.2.0

09 Feb 21:50

Choose a tag to compare

Add std::format support for delta types

v1.1.1

18 Jan 16:52

Choose a tag to compare

Bug Fixes

  • Fix ESP-IDF script mode compatibility by moving ESP_PLATFORM check before project()

v1.1.0

18 Jan 16:45

Choose a tag to compare

What's New

  • Add ESP-IDF component support for publishing to the ESP Component Registry
  • Add idf_component.yml manifest
  • Add ESP_PLATFORM detection in CMakeLists.txt
  • Added rounding functions thermo::floor, thermo::ceil, thermo::round, thermo::trunc

The component is now available at: https://components.espressif.com/components/cleishm/thermo

v1.0.0 - First Stable Release

17 Jan 06:10

Choose a tag to compare

First Stable Release

thermo-cpp is a type-safe, header-only C++23 library for temperature handling, modeled after std::chrono.

📚 Full API Documentation

Features

  • Type-safe temperatures with distinct types for Celsius, Kelvin, and Fahrenheit
  • Configurable precision: degree, decidegree, millidegree
  • Automatic conversions between scales and precisions
  • Lossless implicit conversions (lossy conversions require explicit casts)
  • Temperature deltas distinct from absolute temperatures
  • User-defined literals for concise notation (20_c, 32_f, 273_k)
  • std::format support (when available)
  • Fully constexpr: All operations can be evaluated at compile time

Requirements

  • C++23 compiler (GCC 13+, Clang 17+, MSVC 19.36+)
  • MSVC users require: /std:c++latest, /Zc:__cplusplus, /utf-8

Installation

Using vcpkg

vcpkg install cleishm-thermo-cpp

Using CMake FetchContent

include(FetchContent)
FetchContent_Declare(
    thermo
    GIT_REPOSITORY https://github.com/cleishm/thermo-cpp.git
    GIT_TAG v1.0.0
)
FetchContent_MakeAvailable(thermo)

target_link_libraries(your_target PRIVATE thermo::thermo)

Manual Installation

Copy the include/thermo/ directory to your project.

Quick Start

#include <thermo/thermo>

using namespace thermo;
using namespace thermo_literals;

// Absolute temperatures
auto room_temp = 20_c;
auto boiling = 100_c;
auto absolute_zero = 0_k;
auto body_temp = 98.6_f;

// Temperature deltas (differences)
auto delta = 5_Δc;
auto new_temp = room_temp + delta;  // 25°C

// Comparisons work across precisions
if (millicelsius{20000} == celsius{20}) {
    // true - same temperature, different precision
}

// String conversion
std::string s = to_string(room_temp);  // "20°C"

Documentation

See the API Documentation and README for complete details.