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 support for "no unit" type #41

Closed bladan closed 4 years ago

bladan commented 4 years ago

Altough we could use standard C++ variable types such as double or int, a "no unit" type could be useful:

bernedom commented 4 years ago

Decided not to implement this. Scalars without a type should be exactly that, so wrapping them artificially does somehow defeat the purpose of SI being transparent with standard types. C++20 will bring us mathematical constants as library function so wrapping this might break future compatibility. As for percentage since % is not allowed in the literal this would be quite difficult to achieve