Physical base unit type template.
More...
#include <GREM/physics/quantities.hpp>
|
template<unit OtherUnitT>
requires (OtherUnitT::DIMENSION == D && OtherUnitT::MagnitudeType::VALUE == MagnitudeType::VALUE && OtherUnitT::MagnitudeType::IS_ABSOLUTE && !MagnitudeType::IS_ABSOLUTE) |
| consteval | operator OtherUnitT () const |
| | Implicitly convert this unit to another unit, where allowed.
|
| consteval auto | operator+ () const |
| | Get the canonical unit resulting from taking the additive identity of a quantity of this unit.
|
| consteval auto | operator- () const |
| | Get the canonical unit resulting from taking the additive inverse of a quantity of this unit.
|
| template<unit OtherUnitT> |
| consteval auto | operator+ (const OtherUnitT &other) const |
| | Get the canonical unit resulting from adding a quantity of another unit to a quantity of this unit.
|
| template<unit OtherUnitT> |
| consteval auto | operator- (const OtherUnitT &other) const |
| | Get the canonical unit resulting from subtracting a quantity of another unit from a quantity of this unit.
|
| template<unit OtherUnitT> |
| consteval auto | operator* (const OtherUnitT &other) const |
| | Get the canonical unit resulting from multiplying a quantity of this unit with a quantity of another unit.
|
| template<unit OtherUnitT> |
| consteval auto | operator/ (const OtherUnitT &other) const |
| | Get the canonical unit resulting from dividing a quantity of this unit by a quantity of another unit.
|
|
| static constexpr auto | getSymbolString () |
| | Get an ASCII string representation of the unit symbol of this unit, e.g. "kg m^2/s" if D is ANGULAR_MOMENTUM and M is 1.
|
Physical base unit type template.
- Template Parameters
-
| D | dimension of the unit. |
| M | magnitude of the unit. |
◆ DimensionType
◆ MagnitudeType
Magintude type of the unit.
◆ getSymbolString()
|
|
inlinestaticnodiscardconstexpr |
Get an ASCII string representation of the unit symbol of this unit, e.g. "kg m^2/s" if D is ANGULAR_MOMENTUM and M is 1.
- Returns
- a String or StringView of the unit symbol string.
◆ operator OtherUnitT()
template<unit OtherUnitT>
requires (OtherUnitT::DIMENSION == D && OtherUnitT::MagnitudeType::VALUE == MagnitudeType::VALUE && OtherUnitT::MagnitudeType::IS_ABSOLUTE && !MagnitudeType::IS_ABSOLUTE)
Implicitly convert this unit to another unit, where allowed.
- Template Parameters
-
| OtherUnitT | unit type to convert to. |
- Returns
- the converted unit.
◆ operator+() [1/2]
Get the canonical unit resulting from taking the additive identity of a quantity of this unit.
- Returns
- the resulting unit.
◆ operator-() [1/2]
Get the canonical unit resulting from taking the additive inverse of a quantity of this unit.
- Returns
- the resulting unit.
◆ operator+() [2/2]
template<unit OtherUnitT>
Get the canonical unit resulting from adding a quantity of another unit to a quantity of this unit.
- Parameters
-
| other | the unit to add to this one. |
- Returns
- the resulting unit.
◆ operator-() [2/2]
template<unit OtherUnitT>
Get the canonical unit resulting from subtracting a quantity of another unit from a quantity of this unit.
- Parameters
-
| other | the unit to subtract from this one. |
- Returns
- the resulting unit.
◆ operator*()
template<unit OtherUnitT>
Get the canonical unit resulting from multiplying a quantity of this unit with a quantity of another unit.
- Parameters
-
| other | the unit to multiply this one with. |
- Returns
- the resulting unit.
◆ operator/()
template<unit OtherUnitT>
Get the canonical unit resulting from dividing a quantity of this unit by a quantity of another unit.
- Parameters
-
| other | the unit to divide this one by. |
- Returns
- the resulting unit.
◆ DIMENSION
◆ MAGNITUDE
The documentation for this struct was generated from the following file: