|
thermo 2.1.1
Type-safe temperature handling library modeled after std::chrono
|
A temperature difference with a representation and precision. More...
#include <thermo/thermo.hpp>
Public Types | |
| using | rep = Rep |
| The representation type. | |
| using | precision = typename Precision::type |
| The precision as a std::ratio. | |
Static Public Member Functions | |
| static constexpr delta | zero () noexcept |
| Returns a zero-length delta. | |
| static constexpr delta | min () noexcept |
| Returns the minimum (most negative) representable delta. | |
| static constexpr delta | max () noexcept |
| Returns the maximum representable delta. | |
A temperature difference with a representation and precision.
Similar to std::chrono::duration, delta represents the difference between two temperatures. The precision is expressed as a std::ratio of one base unit (Kelvin or Celsius degree).
| Rep | Arithmetic type for the tick count. |
| Precision | A std::ratio representing the precision (default: 1). |
Definition at line 122 of file thermo.hpp.
| using thermo::delta< Rep, Precision >::precision = typename Precision::type |
The precision as a std::ratio.
Definition at line 131 of file thermo.hpp.
The representation type.
Definition at line 129 of file thermo.hpp.
|
constexprdefault |
Constructs a zero delta.
Referenced by thermo::delta< Rep, Precision >::max(), thermo::delta< Rep, Precision >::min(), thermo::delta< Rep, Precision >::operator++(), thermo::delta< Rep, Precision >::operator--(), and thermo::delta< Rep, Precision >::zero().
|
inlineexplicitconstexpr |
Constructs from a tick count.
Implicit for inexact types, explicit otherwise to prevent accidental precision loss.
| Rep2 | The source representation type. |
| r | The tick count. |
Definition at line 148 of file thermo.hpp.
|
inlineconstexpr |
Constructs from another delta with different representation or precision.
Implicit when the conversion is lossless (target precision evenly divides source precision). Explicit otherwise.
| Rep2 | Source representation type. |
| Precision2 | Source precision. |
| temp | The source delta. |
Definition at line 164 of file thermo.hpp.
|
inlineconstexpr |
Returns the tick count.
Definition at line 171 of file thermo.hpp.
Referenced by thermo::delta_cast(), thermo::delta< Rep, Precision >::operator+=(), thermo::delta< Rep, Precision >::operator-=(), thermo::operator/(), thermo::operator<=>(), and thermo::operator==().
Returns the maximum representable delta.
Definition at line 236 of file thermo.hpp.
References thermo::delta< Rep, Precision >::delta().
Returns the minimum (most negative) representable delta.
Definition at line 233 of file thermo.hpp.
References thermo::delta< Rep, Precision >::delta().
|
inlineconstexpr |
Definition at line 222 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 215 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 205 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 173 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 181 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 186 of file thermo.hpp.
References thermo::delta< Rep, Precision >::delta().
|
inlineconstexpr |
Definition at line 195 of file thermo.hpp.
References thermo::delta< Rep, Precision >::count().
|
inlineconstexpr |
Definition at line 177 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 188 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 193 of file thermo.hpp.
References thermo::delta< Rep, Precision >::delta().
|
inlineconstexpr |
Definition at line 200 of file thermo.hpp.
References thermo::delta< Rep, Precision >::count().
|
inlineconstexpr |
Definition at line 210 of file thermo.hpp.
|
default |
Returns a zero-length delta.
Definition at line 230 of file thermo.hpp.
References thermo::delta< Rep, Precision >::delta().