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:
@@ -36,13 +36,13 @@ void example()
|
||||
using namespace units::physical;
|
||||
using namespace units::physical::si::literals;
|
||||
|
||||
Length auto d1 = 123q_m;
|
||||
Time auto t1 = 10q_s;
|
||||
Length auto d1 = 123_q_m;
|
||||
Time auto t1 = 10_q_s;
|
||||
Speed auto v1 = avg_speed(d1, t1);
|
||||
|
||||
auto temp1 = v1 * 50q_m; // produces intermediate unknown dimension with 'unknown_coherent_unit' as its 'coherent_unit'
|
||||
Speed auto v2 = temp1 / 100q_m; // back to known dimensions again
|
||||
Length auto d2 = v2 * 60q_s;
|
||||
auto temp1 = v1 * 50_q_m; // produces intermediate unknown dimension with 'unknown_coherent_unit' as its 'coherent_unit'
|
||||
Speed auto v2 = temp1 / 100_q_m; // back to known dimensions again
|
||||
Length auto d2 = v2 * 60_q_s;
|
||||
|
||||
std::cout << "d1 = " << d1 << '\n';
|
||||
std::cout << "t1 = " << t1 << '\n';
|
||||
|
Reference in New Issue
Block a user