xo-unit: quantity: + with_unit() + with_repr() convenience
This commit is contained in:
parent
a785480d28
commit
bb5fc1cb4e
1 changed files with 6 additions and 0 deletions
|
|
@ -77,6 +77,12 @@ namespace xo {
|
||||||
return promoter<Unit, Repr>::promote(x);
|
return promoter<Unit, Repr>::promote(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename Unit2>
|
||||||
|
constexpr quantity<Unit2, Repr> with_unit() const { return *this; }
|
||||||
|
|
||||||
|
template <typename Repr2>
|
||||||
|
constexpr quantity<unit_type, Repr2> with_repr() const { return quantity<unit_type, Repr2>::promote(scale_); }
|
||||||
|
|
||||||
template <typename Quantity2>
|
template <typename Quantity2>
|
||||||
auto multiply(Quantity2 y) const {
|
auto multiply(Quantity2 y) const {
|
||||||
//constexpr bool c_debug_flag = false;
|
//constexpr bool c_debug_flag = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue