diff --git a/example/ex3/CMakeLists.txt b/example/ex3/CMakeLists.txt index acd7d587..b3f1bc19 100644 --- a/example/ex3/CMakeLists.txt +++ b/example/ex3/CMakeLists.txt @@ -10,6 +10,6 @@ xo_include_options2(${SELF_EXE}) # dependencies.. xo_self_headeronly_dependency(${SELF_EXE} xo_unit) -#xo_dependency(${SELF_EXE} reflect) +xo_dependency(${SELF_EXE} xo_flatstring) # end CMakeLists.txt diff --git a/example/ex3/ex3.cpp b/example/ex3/ex3.cpp index 623d2239..d13343f3 100644 --- a/example/ex3/ex3.cpp +++ b/example/ex3/ex3.cpp @@ -1,18 +1,28 @@ /** @file ex3.cpp **/ -#include "xo/unit/mpl/quantity.hpp" +#include "xo/unit/quantity.hpp" +#include "xo/unit/quantity_iostream.hpp" #include int main () { - namespace u = xo::unit::units; - namespace qty = xo::unit::qty; + namespace q = xo::qty::qty; + namespace u = xo::qty::nu; + using xo::qty::with_units; + using xo::qty::stdquantity; + using xo::qty::quantity; + using xo::flatstring; using namespace std; - auto t1 = qty::milliseconds(1); - auto t2 = qty::minutes(1); + constexpr stdquantity t = q::minutes(2); + constexpr stdquantity d = q::kilometers(2.5); - cerr << "t1: " << t1 << ", t2: " << t2 << ", t1*t2: " << t1*t2 << endl; + constexpr auto t2 = t*t; + constexpr auto a = d / (t*t); + + cerr << "t: " << t << ", d: " << d + << ", d.t^-2: " << a + << endl; } /** end ex3.cpp **/