v2.1.0
New features:
-
Literal suffixes for instantiating unit containers (c++14 compliant compiler required).
auto area = 3.0_m * 4.0_m; // area == square_meter_t(12.0) == 12_sq_m;
-
std::cout
output now includes the unit abbreviations.mile_t distance(26.2); std::cout << distance; // printed: 26.2 mi
-
Unit-to-built-in-type conversions using
to<>
orunit_cast
.mile_t distance(26.2); double result = unit_cast<double>(distance); // result == 26.2
-
Unit definition macros.
UNIT_ADD(length, foot, feet, ft, unit<std::ratio<381, 1250>, meters>)
-
Improvements for integral unit types.
Notes:
- Due to incompatibilites with the
WINAPI
, the literal abbreviation fortesla
units are_Te
, instead of the SI standard_T
.
Tested on:
- gcc-4.9.3
- gcc-5.4.0
- msvc2013
- msvc2015