Releases: cleishm/thermo-cpp
Releases · cleishm/thermo-cpp
v1.2.1
v1.2.0
v1.1.1
v1.1.0
What's New
- Add ESP-IDF component support for publishing to the ESP Component Registry
- Add
idf_component.ymlmanifest - Add
ESP_PLATFORMdetection 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
First Stable Release
thermo-cpp is a type-safe, header-only C++23 library for temperature handling, modeled after std::chrono.
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::formatsupport (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-cppUsing 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.