Add 'xo-unit/' from commit 'b531e382c2'
git-subtree-dir: xo-unit git-subtree-mainline:e9ee6992cagit-subtree-split:b531e382c2
This commit is contained in:
commit
d1fa15f248
105 changed files with 11790 additions and 0 deletions
25
xo-unit/example/ex3/ex3.cpp
Normal file
25
xo-unit/example/ex3/ex3.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/** @file ex3.cpp **/
|
||||
|
||||
#include "xo/unit/quantity.hpp"
|
||||
#include "xo/unit/quantity_iostream.hpp"
|
||||
#include <iostream>
|
||||
|
||||
int
|
||||
main () {
|
||||
namespace q = xo::qty::qty;
|
||||
namespace u = xo::qty::u;
|
||||
using xo::qty::quantity;
|
||||
using namespace std;
|
||||
|
||||
constexpr quantity<u::second> t = q::minutes(2);
|
||||
constexpr quantity<u::meter> d = q::kilometers(2.5);
|
||||
|
||||
constexpr auto t2 = t*t;
|
||||
constexpr auto a = d / (t*t);
|
||||
|
||||
cerr << "t: " << t << ", d: " << d
|
||||
<< ", d.t^-2: " << a
|
||||
<< endl;
|
||||
}
|
||||
|
||||
/** end ex3.cpp **/
|
||||
Loading…
Add table
Add a link
Reference in a new issue