xo-unit: qty::grams() etc. infer quantity::repr_type from argument
This commit is contained in:
parent
a0d5991d01
commit
c5c2f83c90
2 changed files with 72 additions and 38 deletions
|
|
@ -7,13 +7,13 @@
|
|||
int
|
||||
main () {
|
||||
namespace q = xo::qty::qty;
|
||||
namespace u = xo::qty::nu;
|
||||
namespace nu = xo::qty::nu;
|
||||
using xo::qty::quantity;
|
||||
using xo::flatstring;
|
||||
using namespace std;
|
||||
|
||||
constexpr quantity<u::second> t = q::minutes(2);
|
||||
constexpr quantity<u::meter> d = q::kilometers(2.5);
|
||||
constexpr quantity<nu::second> t = q::minutes(2);
|
||||
constexpr quantity<nu::meter> d = q::kilometers(2.5);
|
||||
|
||||
constexpr auto t2 = t*t;
|
||||
constexpr auto a = d / (t*t);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue