The quantities and units library for C++
inverse()
support added for dimensions, quantity_spec, units, and references
(1 / s
will now create quantity
and not a Unit
)quantity_point
does not provide zero()
anymorequantity_spec
and its kind should not compare equalfixed_string
common_type
with a raw value is not needed anymore as for a long time now raw values are
not convertible to the dimensionless quantitiessymbol_text
definition simplifiedbasic_fixed_string(const CharT*, std::integral_constant<std::size_t, N>)
constructor addedisq::activity
added and becquerel
definition updated to benefit from itgray
and sievert
now have correct associated quantity kindsUnitCompatibleWith
concept added and applied to in(U)
and force_in(U)
functionsMagnitude / Unit
operator addedderived_dimension
)zero_Fahrenheit
point origin addedunit_symbol<fmt>(U)
signature refactored and the resulting text can now also be used at runtimemake_xxx
factory functions replaced with two-parameter constructorsunit_symbol
changed to consteval
in(U)
and force_in(U)
now return auto
to provide better diagnostics on clangquantity
operators constraints refactoredfixed_string
definitionunit_symbol_formatting
enums now use std::int8_t
as a representation typeunit_symbol
CommonlyInvocableQuantities
was overconstrained for the current library designare_ingredients_convertible
now mandates explicit conversion for To
dimensionless quantitiesquantity_point::point_for(PO)
constraints fixedlatitude
and longitude
fixed to include 0
for N
and E
respectivelyCameCase
concept identifiers FAQ addedgravitational_potential_energy
equation fixed on a graphIMPORTANT: This is a breaking release. The mp-units library got totally new look & feel with the V2 engine.
units
namespace renamed to mp_units
(#317)<mp-units/...>
rather then in <units/...>
(#317)quantity_point
(#414)quantity_spec
to store not only dimension
but also additional information about quantities (#405)quantity
now takes reference
object, which aggregates quantity_spec
and a unit
and a representation
typefmt
quantity_kind
removed.in(Unit)
, .force_in(Unit)
for quantity
and quantity_spec
.numerical_value_in(Unit)
and .force_numerical_value_in(Unit)
quantity
can no longer be constructed with a raw value (#434)quantity_point
can no longer be constructed with just a quantity
and an explicit PointOrigin
is always neededceil
and floor
are dangerous (#432)common_quantity
, common_quantity_for
, common_quantity_point
, common_quantity_kind
, and common_quantity_point_kind
removednamed_derived_unit
removed as it was not usedderived_unit
renamed to derived_scaled_unit
unit
renamed to derived_unit
U::is_named
removed from the unit types and replaced with NamedUnit
conceptPrefixFamily
support removedmi(naut)
renamed to nmi
knot
unit helper renamed to kn
in FPSknot
text symbol changed from "knot"
to "kn"
quantity
op+()
and op-()
reimplemented in terms of reference
rather then quantity
typesglide_computer
now use dimensionless quantities with ranged_representation
as rep
floor()
, ceil()
, and round()
support added (thanks @hofbi)std::format
support for compliant compilers addedmp-units
to std::chrono
types addedquantity_point
to std::chrono::time_point
addednautical_mile_per_hour
and knot
added to si::international
systemquantity_point::origin
, like std::chrono::time_point::clock
hectare
definition fixed to be a prefixed version of are
+ other unitsquantity_point_cast
's constraintfmt
algorithms were overconstrained with forward_iterator
derived_ratio
calculationfill_t
assignment operator fixedradioactivity
header compilation fixedsi::hep::dim_momentum
duplicated definition fixedfps
can now coexist with international
systemCMAKE_BUILD_TYPE
in the conan_toolchain.cmake
anymoreconanfile.py
refactored to be Conan 2.0 readyvalidate()
replaced with configure()
to raise errors during conan install
in Conan 1.Xlinear-algebra
Conan repo is no needed anymoremp-units-system
CITATION.cff
file addedCONTRIBUTING.md
updatedScalableNumber
renamed to Representation
units/quantity_io.h
header filequantity::count()
renamed to quantity::number()
data
system renamed to isq::iec80000
(quantity names renamed too)*deduced_unit
renamed to *derived_unit
noble_derived_unit
quantity
quantity
and quantity_cast
refactoredabs()
definition refactored to be more explicit about the return typestd::chrono::duration
and other units librariesmodulation_rate
support added (thanks @go2sh)isq::iec80000
support added (thanks @go2sh)UNITS_NO_LITERALS
preprocessor definequantity_cast()
generates less assembly instructionsquantity::op<<()
equivalent
trait usageexp()
has sense only for dimensionless quantitiesdim_torque
now properly divides by an angle (instead of multiply) + default unit name changequantity_cast()
fixed to work correctly with representation types not convertible from std::intmax_t
foot_pound_force
and foot_pound_force_per_second
BUILD_DOCS
CMake option renamed to UNITS_BUILD_DOCS
cmake_find_package_multi
quantity_point
support added (thanks @johelegp)si::angular_velocity
support added (thanks @mikeford3)exp(quantity)
q_*
UDL renamed to _q_*
*p*
to *_per_*
ratio
changed to the NTTP kindexp
and Exp
renamed to exponent
and Exponent
Scalar
concept renamed to ScalableNumber
quantity
typemath.h
function signatures refactored to use a Quantity
concept (thanks @kwikius)[[nodiscard]]
added to many functionssi::day
unit symbol fixed to d
(thanks @komputerwiz)si::mole
unit symbol fixed to mol
(thanks @mikeford3)ratio
refactored to contain Exp
template parameter (thanks a lot @oschonrock!)q_
prefix applied to all the UDLs (thanks @kwikius)unknown_unit
renamed to unknown_coherent_unit
std::experimental::math
support addedalias_unit
(thanks @yasamoka)physical
namespaceMany thanks to GitHub users @oschonrock, @kwikius, and @i-ky for their support in drafting a new library design.
exp
addedpow()
and sqrt()
operations on quantitiesunits
removed from a std::experimental
namespacebase_dimension
class templatebase_dimension
and derived unitsoperator<<
on quantity
fmt
support addedstd::remove_cvref_t
, down with typename, std::type_identity
)type_list
, common_ratio
, ratio
, conditional_t
)