Skip to content

v2.1.0

Compare
Choose a tag to compare
@nholthaus nholthaus released this 25 Sep 13:55
· 121 commits to master since this release

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<> or unit_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 for tesla units are _Te, instead of the SI standard _T.

Tested on:

  • gcc-4.9.3
  • gcc-5.4.0
  • msvc2013
  • msvc2015