mirror of
https://github.com/mpusz/mp-units.git
synced 2026-01-30 10:12:17 +01:00
refactor(example): RepresentationOf support added to examples
This commit is contained in:
@@ -31,6 +31,10 @@
|
||||
#include <iostream>
|
||||
#include <utility>
|
||||
|
||||
template<class T>
|
||||
requires units::is_scalar<T>
|
||||
inline constexpr bool units::is_vector<T> = true;
|
||||
|
||||
namespace {
|
||||
|
||||
using namespace units;
|
||||
@@ -57,7 +61,7 @@ public:
|
||||
return quantity_cast<isq::weight>(mass * g);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr quantity<isq::length[m]> fill_level(const quantity<isq::mass[kg]>& measured_mass) const
|
||||
[[nodiscard]] constexpr quantity<isq::height[m]> fill_level(const quantity<isq::mass[kg]>& measured_mass) const
|
||||
{
|
||||
return height_ * measured_mass * g / filled_weight();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user