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
488 stars 40 forks source link

Add .str() to avoid using << #40

Closed bladan closed 4 years ago

bladan commented 4 years ago

As we use a formatting libary with { }, we would like to avoid the SI stream operator <<. Adding a .str() function might be useful.

bernedom commented 4 years ago

Next version will include a SI::to_string(unit_t) method to create string conversion without the need for streaming operators. It is not a member function of unit_t to avoid forcing all users to include any string or stream functionality all the time,