xo-unit: docs: + example programs
This commit is contained in:
parent
d9868870e4
commit
0d9fd75b0c
8 changed files with 103 additions and 0 deletions
18
example/ex1/ex1.cpp
Normal file
18
example/ex1/ex1.cpp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/** @file ex1.cpp **/
|
||||
|
||||
#include "xo/unit/quantity.hpp"
|
||||
#include <iostream>
|
||||
|
||||
int
|
||||
main () {
|
||||
namespace qty = xo::obs::qty;
|
||||
using namespace std;
|
||||
|
||||
auto t = qty::milliseconds(10);
|
||||
auto m = qty::kilograms(2.5);
|
||||
auto a = m / (t*t);
|
||||
|
||||
cerr << "t: " << t << ", m: " << m << ", m.t^-2: " << a << endl;
|
||||
}
|
||||
|
||||
/** end ex1.cpp **/
|
||||
Loading…
Add table
Add a link
Reference in a new issue