|
thermo 2.1.0
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 121 of file thermo.hpp.
| using thermo::delta< Rep, Precision >::precision = typename Precision::type |
The precision as a std::ratio.
Definition at line 130 of file thermo.hpp.
The representation type.
Definition at line 128 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 147 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 163 of file thermo.hpp.
|
inlineconstexpr |
Returns the tick count.
Definition at line 170 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 235 of file thermo.hpp.
References thermo::delta< Rep, Precision >::delta().
Returns the minimum (most negative) representable delta.
Definition at line 232 of file thermo.hpp.
References thermo::delta< Rep, Precision >::delta().
|
inlineconstexpr |
Definition at line 221 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 214 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 204 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 172 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 180 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 185 of file thermo.hpp.
References thermo::delta< Rep, Precision >::delta().
|
inlineconstexpr |
Definition at line 194 of file thermo.hpp.
References thermo::delta< Rep, Precision >::count().
|
inlineconstexpr |
Definition at line 176 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 187 of file thermo.hpp.
|
inlineconstexpr |
Definition at line 192 of file thermo.hpp.
References thermo::delta< Rep, Precision >::delta().
|
inlineconstexpr |
Definition at line 199 of file thermo.hpp.
References thermo::delta< Rep, Precision >::count().
|
inlineconstexpr |
Definition at line 209 of file thermo.hpp.
|
default |
Returns a zero-length delta.
Definition at line 229 of file thermo.hpp.
References thermo::delta< Rep, Precision >::delta().