xo-unit: example: + ex4 .. ex6
This commit is contained in:
parent
7c7373427e
commit
ba31d2c112
7 changed files with 116 additions and 0 deletions
19
example/ex6/ex6.cpp
Normal file
19
example/ex6/ex6.cpp
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/** @file ex6.cpp **/
|
||||
|
||||
#include "xo/unit/quantity.hpp"
|
||||
#include <iostream>
|
||||
|
||||
int
|
||||
main () {
|
||||
namespace u = xo::unit::units;
|
||||
namespace qty = xo::unit::qty;
|
||||
using namespace std;
|
||||
|
||||
auto t1 = qty::milliseconds(25.0);
|
||||
auto t1_usec = t1.with_unit<u::microsecond>();
|
||||
auto t1_sec = t1.with_unit<u::second>();
|
||||
|
||||
cerr << "t1: " << t1 << ", t1_usec: " << t1_usec << ", t1_sec: " << t1_sec << endl;
|
||||
}
|
||||
|
||||
/** end ex6.cpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue