0.3.3
Release Notes
User-facing library changes
Here are some of the most notable changes. We'll list potentially
breaking changes first, then give sections for a few highlighted
changes, and finally group the remaining changes together.
Potentially breaking changes:
- Magnitude trait updates (#138)
numerator(m)
anddenominator(m)
no longer apply only to
the integer part; they now apply to "everything on top of
(numerator
) or below (denominator
) the bar" when the
magnitude is written as a fraction- To get the old behaviour, you can use the new
integer_part
trait: for example, writingnumerator(integer_part(m))
to
replace what would previously have beennumerator(m)
- Label for Fahrenheit changed from
"F"
to"degF"
(#141) - Tightened up integer division safeguards: the new policy is to prevent
this any time the denominator has units (even if the numerator is a
raw number) (#142)
First official Windows support!
- We found and fixed some compiler errors on several versions of MSVC
(#146, #151) - Added CI jobs for Windows too (#151)
New, intent-based APIs for "forcing" unit conversions (#171)
coerce
is a new vocabulary word which means "ignore safety checks
for truncation and overflow". Before this, we used "explicit rep" to
express this (e.g., the<int>
ininches(24).as<int>(feet)
). But
now we can writeinches(24).coerce_as(feet)
to do the same thing.
It's both clearer in its intent, and it doesn't force you to repeat
the rep!- For now, we're providing only
coerce_in
andcoerce_as
member
functions to complementin
andas
member functions, in both
Quantity
andQuantityPoint
. Later on, we may add the "coerce"
word to more APIs where it could be useful. - You can still provide an explicit rep if you want to control the rep
of the result: for example,inches(25.8).coerce_as<int>(feet)
producesfeet(2)
.
Other Enhancements:
- New function
clamp(v, lo, hi)
: a unit-aware analogue of
std::clamp()
from C++17 (#165) sqrt
,cbrt
,inverse
,squared
, andcubed
can now be applied
to dimensions and magnitudes, not just units (#136)- New trait
integer_part(m)
picks out the integer part of a magnitude
(#138) - New rep-named aliases for
int
(QuantityI
,QuantityPointI
) and
unsigned int
(QuantityU
,QuantityPointU
) (#150) - Improved dimensionless unit support in our nholthaus library
interoperation (#161) - Made "dangerous conversion" error messages less confusing (#158)
- Enable compatibility with
-Wconversion
: Au will not add any
violations (#166) - Made most unit traits compatible with unit slots (e.g., you can now
writeunit_ratio(micro(meters), inches)
) (#168)
New units
Tooling updates
- Fixed tools
au-docs-serve
,buildifier
, andclang-format
for
people who do not usedirenv
, making the library much easier for
everyone to start using (#148)
Documentation updates
This release had a major impact on documentation. Here are all of the
new and significantly updated docs, listed in their place in the
hierarchy:
- Discussion
- How-to guides
- Reference
Additionally, we had the following documentation updates:
- Documentation is now versioned, using
mike (#132, #133) - Added
CONTRIBUTING.md
guidelines (#129)- Included style guide (#164)
- Clarified our tiers of support for different compilers (#156)
- We significantly refreshed our alternatives matrix: (#147)
- Added the bernedom/SI library
- Solicited input from units library authors
- Added new rows to our comparison: "Unit-aware I/O", "Unit-aware
math", "Linear algebra", and "Physical constants"
- Refreshed troubleshooting page (#158, #172)
- Added MSVC compiler errors (#163)
Repo updates
- Added CI jobs for Windows (#151)
- Renamed
BUILD
toBUILD.bazel
, unblocking usage on case-insensitive
filesystems such as MacOS (#170) - Added status badges (#154, #155)
- Fixed security alerts:
Closed Issues
Here are all of the issues that were closed between these releases.
(Note that the resolution is at the level of days, so some of these
issues might show up in the notes for more than one release.)
https://github.com/aurora-opensource/au/issues?q=is%3Aissue+closed%3A2023-03-20..2023-09-01
Contributors
Thanks to those who authored or reviewed PRs, or filed or participated
in Issues! Alphabetically: