bernedom / SI

A header only C++ library that provides type safety and user defined literals for physical units
https://si.dominikberner.ch/doc/
MIT License
499 stars 40 forks source link

I/O functions implementation from/to console and file #13

Closed sergioferrari closed 5 years ago

sergioferrari commented 5 years ago

Obviously, the users of SI library, needs to input values at runtime and view outputs from applications

In my opinion, if I use a certain physical unit in a determinate scale, I want to see (for default) the variable's value in the scale I chose, with the related symbol

I am a C ++ amateur and certainly I cannot afford to offer you solutions, especially about generic programming, with extensive use of templates

bernedom commented 5 years ago

Have a look at the current master or the 1.3.0 unstable conan package on bintray Streaming to the test/console/files are there.

example:

constexpr auto value = 1_km;
  std::stringstream ss;
  ss << value;   // ss now contains "1km"

Reading from streams is currently being developed

bernedom commented 5 years ago

Available from version 1.3.0 on