forked from mpusz/mp-units
refactor: 💥 q_*
UDL renamed to _q_*
We had some fun exploring the STD UDLs for potential collisions, we have learnt our lesson and know how to proceed. Now is high time to start behaving and obeying C++ rules.
This commit is contained in:
@@ -25,7 +25,7 @@ inline constexpr auto g = si::si2019::standard_gravity<>;
|
||||
} // namespace
|
||||
|
||||
struct Box {
|
||||
static constexpr auto air_density = 1.225q_kg_per_m3;
|
||||
static constexpr auto air_density = 1.225_q_kg_per_m3;
|
||||
|
||||
si::length<m> length;
|
||||
si::length<m> width;
|
||||
@@ -65,11 +65,11 @@ struct Box {
|
||||
|
||||
int main()
|
||||
{
|
||||
auto box = Box(1000.0q_mm, 500.0q_mm, 200.0q_mm);
|
||||
box.set_contents_density(1000.0q_kg_per_m3);
|
||||
auto box = Box(1000.0_q_mm, 500.0_q_mm, 200.0_q_mm);
|
||||
box.set_contents_density(1000.0_q_kg_per_m3);
|
||||
|
||||
const auto fill_time = 200.0q_s; // time since starting fill
|
||||
const auto measured_mass = 20.0q_kg; // measured mass at fill_time
|
||||
const auto fill_time = 200.0_q_s; // time since starting fill
|
||||
const auto measured_mass = 20.0_q_kg; // measured mass at fill_time
|
||||
|
||||
std::cout << "mp-units box example...\n";
|
||||
std::cout << "fill height at " << fill_time << " = " << box.fill_level(measured_mass) << " ("
|
||||
|
Reference in New Issue
Block a user