Releases: nholthaus/units
Releases · nholthaus/units
v2.3.0 RC 1
Release Candidate 1 for v2.3.0
- Adds data units (bits/bytes) and data transfer units as first-class citizens
- Adds
std::cout
support for units with no defined abbreviation (they show up as a combination of SI base units) - Adds compound assignment operators:
+=
,-=
,/=
,*=
. - Adds
value()
member for accessing underlying type. - Adds
value_type
trait, as a synonym forunderlying_type
. - Adds definitions for Julian and Gregorian years.
Notes:
- Provisionally removes compiler support for MSVC2013.
- No documentation updates are included in this candidate.
v2.2.0
New Features:
- Unit types and member functions are now
constexpr
andnoexcept
wherever possible. - Added
cpow<..>()
, aconstexpr
power function. - Added
make_unit
factory function. - Added cmath
hypot()
function. - Added optional definition to disable IOStream in embedded applications.
Improvements:
- New and improved
pi
constant units::time
andstd::chrono
are now interoperable- eliminated warnings on gcc when using
-Wall -Wextra -pedantic
v2.1.3
New features:
- Added a CMake
interface
project so thatunits
can be more easily included as a git submodule or CMake subdirectory. - Added options to disable building unit tests and documentation.
Improvements:
- Removed all GNU dependencies
- Updated google test to version 1.8.0 and simplified the build process
- improved overall units compile time.
v2.1.2
v2.1.1
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