xo-unit: + Quantity.scale_by()
This commit is contained in:
parent
8ec337c589
commit
4d092dcbc2
1 changed files with 6 additions and 0 deletions
|
|
@ -60,6 +60,12 @@ namespace xo {
|
|||
}
|
||||
}
|
||||
|
||||
template <typename Dimensionless>
|
||||
requires std::is_arithmetic_v<Dimensionless>
|
||||
constexpr auto scale_by(Dimensionless x) const {
|
||||
return Quantity(x * this->scale_, this->unit_);
|
||||
}
|
||||
|
||||
template <typename Quantity2>
|
||||
static constexpr
|
||||
auto multiply(const Quantity & x, const Quantity2 & y) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue