Release Notes¶
This page documents the version history and changes for the mp-units library.
mp-units¶
2.6.0 TBD¶
- fix: the displacement between two point origins keeps a named unit that already is the
coarsest exact one, so a
-27 cmorigin offset and the point differences across it print incmrather than in(1/100 m) - refactor:
quantity_from()andquantity_from_zero()of a quantity point are renamed todelta_from()anddelta_from_zero(). They return a delta, and once a point is aquantitytoo, "quantity from" no longer says which one. The former names are deprecated - fix:
magnitudeof an unsigned value returns the value, where it calledstd::abs, which has no unsigned overload - (!) refactor:
char,wchar_t,char8_t,char16_t, andchar32_tare not representation types, asboolisn't. A character type holds a character, not a number, soquantity<si::metre, char>is ill-formed.signed charandunsigned char, the types ofstd::int8_tandstd::uint8_t, stay representation types - feat: a vector quantity composes from a single value holding its components, the
inverse of its tuple protocol:
quantity<flight_velocity[km / h], vec3> v = std::tuple{fwd, lat, vert};. Any type a structured binding decomposes throughstd::tuple_sizeis accepted, its elements read as such a binding reads them, through a membergetor one found by argument-dependent lookup, so a third-party vector works, whichstd::make_from_tuplecannot do. The rules are those of the component-wise constructor, element by element, and the conversion is implicit like it. A quantity, a point, aQuantityLiketype, and a value convertible to the representation are not composed this way, and the deleted truncating constructor of a quantity of unitoneno longer takes such a value for a number - refactor: the customization point that declares the axes of a vector quantity is
component_vectors, after the term ISO 80000-2 uses for the vectors a₁e₁, a₂e₂, and a₃e₃ of a vector. The former namevector_componentsis deprecated. A specialization of it still declares the axes - (!) refactor: the quantity specification conversion engine is reimplemented from a
written specification, the new chapter
Quantity Specification Conversions.
Conversions between two named quantities are unchanged, except where the definitions
listed below changed or the source carries, through its equation, a declared kind its
target doesn't:
isq::period_of_binary_digitscarriesstorage_capacityand converts toisq::durationonly explicitly, as an angle per length does to1 / length. Where quantity equations or kinds take part, a few patterns that used to compile now need an explicit conversion or are ill-formed. A declared kind (is_kind) is a boundary in both directions:quantity<isq::angular_measure[rad]> a = isq::arc_length(arc) / isq::radius(r);needsisq::angular_measure(...),isq::arc_lengthfromangle * rneedsquantity<isq::arc_length[m]>(angle * r), and a product of user-defined quantities needs an explicit conversion to a user-definedis_kindquantity likepixel_area. Under plainisqthe rotational formulas P = τω and E = ½Iω² need the explicit constructor with a unit,quantity<isq::power[W]>(torque * omega)andquantity<isq::kinetic_energy[J]>(...), because ISQ defines torque without an angle and angular velocity with one, and the unit has to drop the angle as well.isq_anglekeeps both implicit (see Strong Angular System). Converting to a kind is no longer more permissive than converting to the quantity it wraps:quantity<si::hertz> f = 1 / isq::time(duration);needsisq::frequency(...), while1 / (2 * s)is unaffected. A kind of a declared sub-kind no longer converts to a sibling branch:isq::mean_queue_length(2 * rad)is ill-formed, convert it withquantity<dimensionless[one]>(...)first. Distinct roots of one dimension stay apart:quantity<Bq * kg> x = f_in_hertz * mass;is ill-formed. A factor common to both sides doesn't change how they relate, and paired factors keep their relation: siblings still needquantity_cast, andisq::energy * isq::time / isq::period_durationconverts toisq::kinetic_energyexplicitly, asisq::energydoes. Conversion-heavy translation units compile in about 30 % less time (isq_test17.8 s -> 12.5 s with GCC 15) - fix: the inverse of an angle no longer converts implicitly to a plain number.
1 / isq::angular_measuretodimensionlessdrops the angle, so it is explicit, and an angle doesn't convert to its own inverse, even withquantity_cast - (!) refactor:
si::newton,si::pascal,si::joule,si::volt,si::farad,si::ohm,si::siemens, andsi::teslano longer carry a quantity kind. A named unit carries one where the SI brochure keeps the name for one quantity,Hz,Bq,Gy,Svandkat, where the library needs it for its own distinctions,rad,sr, the base units, the photometric units, and IEC'svar,bit,baudanderlang. Soquantity<isq::torque[J]>is well-formed and1 * Jconverts to a torque, as1 * N * malways converted to an energy, while1 * Hzstill doesn't convert to an activity, norBq / mto a frequency per length. ISO 80000-1:2009 notes that the joule is not written for a moment of force, and that convention is left to the author - fix: a product of typed quantities converts to its own unit again.
omega * inertiawithomegainrad / shas the unitkg m² rad/s, and a moment of inertia is defined over an angular velocity, so its specification takes the angle away that the velocity brings and the angle looked lost. For a kind source, what a factor's definition takes away now stays apart from what the other factors carry. The angle ofrad / salso died against therotationinrotation * angular_velocitybefore the velocity was expanded. From a kind source, a pairing that would refuse now waits for a factor that mentions the tree, however deep - fix: a product of three typed quantities converts to its own unit when one of them is a
dimensionless count.
omega * inertia * turns, withturnsanisq::rotation, can be read inkg m² rad/sagain. After a sibling pairing from a kind source is deferred, the shallowest factor that has an equation is expanded first, so the angle of the unit meets theangular_velocityand not therotationbeside it - fix: the kind boundary lowers every verdict between two named quantities, and between a
named quantity and a kind, where it used to lower only an
implicitverdict, and from a kind none at all. Akind_of<isq::angular_velocity>converts to a child defined asinverse(isq::duration)only explicitly, and two siblings that each carry a declared kind the other lacks don't convert, as their squares already didn't - (!) fix: ISQ definitions corrected against ISO/IEC 80000.
isq::angular_repetencyisphase_angle / wavelength(k = 2π/λ, likeangular_frequency), so a phase speed ω/k converts tolength / timeimplicitly and1 / wavelengthis an angular repetency only explicitly.isq::inductance,isq::mutual_inductanceandisq::reluctanceare defined overtotal_magnetic_flux(IEC 80000-6 items 6-41.1, 6-41.2 and 6-39) instead ofprotofluxandmagnetic_flux.isq::entropyisheat / thermodynamic_temperature, the thermodynamic definition dS = δQ/T, instead ofkinetic_energy / ....isq::magnetic_constantandisq::electric_constantare children ofpermeabilityandpermittivity(IEC 80000-6 items 6-26.1 and 6-14.1), sorelative_permeabilityandrelative_permittivityare ratios within one tree.isq::propagation_coefficientis a complex quantity withisq::attenuationandisq::phase_coefficientas its real children (ISO 80000-3 item 3-26). The phase coefficient carries a phase angle that the propagation coefficient doesn't, so it converts to its parent only explicitly.isq::isothermal_compressibilityandisq::isentropic_compressibilityare no longeris_kind: ISO 80000-4 item 4-20 treats them as compressibility under a stated condition, so both convert toisq::compressibilityimplicitly and to each other withquantity_cast - fix: the converting constructor of
quantityno longer asks the source for its value in the source's own unit, so a product whose unit carries more angles than its quantity specification (moment_of_inertia * pow<2>(angular_velocity)inkg m² rad²/s²) converts toquantity<isq::kinetic_energy[J]> - fix: a ratio of two quantities of one dimension converts to
dimensionlessagain (isq::width * isq::height / isq::area) - fix:
kind_of<K>relates to a target throughKitself, with its downcasts promoted - (!) fix:
natural::speedis no longeris_kind. It is the plain ratio v/c, so it converts todimensionlessimplicitly - refactor:
iau::parsecis defined as exactly 648 000/π astronomical units instead of an astronomical unit per arcsecond. The numeric value is unchanged - fix: the deprecated
encodingmember ofunit_symbol_formattinganddimension_symbol_formattingis available on Clang again. The library left it out there to avoid a spurious deprecation warning from the implicit copy constructor, so setting it did not compile on Clang andchar_setdid not take its value. Using it now warns on every compiler - fix: Clang with libstdc++ 12, which has no
<format>, now hits the "std::formatting facility not supported" error whenstd::formatis selected. The check used to skip every Clang to accommodate libc++ before 20, which provides<format>without defining__cpp_lib_format. It now skips only that library - fix: the deprecated
mp_units::cartesian_vectorand random-distribution aliases warn on GCC 12 as well. They were plain using-declarations there - fix: Clang diagnostics print the representation type of a deduced
quantityorquantity_point, and of thestd::common_typeof two quantities, as the plain type (int) instead of the library's internal spelling (representation_canonical_type_t<int>,typename Q::rep, orstd::common_type_t<short, unsigned char>). Multiplying or dividing a unit by aquantitynow states why it is ill-formed, as multiplying a unit by a number already did. - fix: a rejected
+,-,%,==or<=>on two quantities of different kinds, and a rejectedhypot, report that the quantities have no common quantity instead of an invalid call toget_common_reference. Three more mistakes get a sentence: a raw number in+,-or%with a dimensioned quantity,quantity_from()with an unrelated origin, andquantity_from_zero()on a point whose origin is not the natural one. AQuantityOf,QuantitySpecOforQuantityPointOfasked with a quantity specification no longer explains the rejected character branch through everystd::is_same_vunder it, which cut Clang's notes for a mismatchedQuantityOfparameter from 149 lines to 31 - fix: a quantity or a point that meets a representation constraint is rejected in one
note (
!disable_representation<…>) instead of three layers of representation concepts, a vector added to a scalar quantity of the same kind reports the representations that have no sum instead of an ill-formedstd::invoke_result, and a representation whose character the quantity does not admit fails a namedCharacterAdmittedconcept. Sentences now also name a quantity of another kind added to or subtracted from a point, a difference or comparison of points with unrelated origins, component-wise construction whose arguments do not fit the axes,fma,fmodandremainderon quantities of different kinds,floor,ceil,roundandinverseto a unit of another kind,quantity_castto a specification it cannot reach,value_castto a quantity type of another specification, and a quantity specification called with a quantity it cannot convert or with a raw number when it is not dimensionless - fix: a conversion whose scaling factor overflows the representation type, such as `1
- Zm + 1 * am
withint, is an unsatisfied constraint on Clang as it is on GCC. It was a hard error there, sincetry_get_valuereturned its disengagedstd::optional` by copy, which Clang rejects in constant evaluation with libstdc++
- Zm + 1 * am
- fix: a
named_unitgiven a quantity specification where a quantity kind is required,named_unit<"x", isq::length>instead ofnamed_unit<"x", kind_of<isq::length>>, fails theNamedUnitArgumentsconstraint with a sentence namingkind_ofinstead of as an incomplete type - feat: the concepts for symbolic types accept a const-qualified type, the way the
standard's type categories do.
Unit<decltype(si::metre)>andQuantitySpec<decltype(isq::length)>now hold, just asQuantity<const Q>always did. Only a non-const type may enter a symbolic expression, sosi::kilo_<const metre>andderived_unit<const metre, per<second>>are still rejected, and dividing aconstsecond by a second still givesone - (!) refactor:
character_setenumerators renamed back tounicodeandbasic, following SG16 review of P3045. The enumeration names a character set, not an encoding, soutf8was the wrong name: UTF-8 is one encoding of Unicode, and which encoding is used is decided by the output type rather than by this selector.utf8andportableremain as deprecated aliases with unchanged values, as doesascii - (!) refactor: every
default_*enumerator is deprecated, again following SG16 review of P3045:character_set::default_character_set,unit_symbol_solidus::default_solidusandunit_symbol_separator::default_separator(and the oldercharacter_set::default_encoding). A name that tracks the default silently changes meaning whenever the default moves, so spell the value you want.unit_symbol_formattinganddimension_symbol_formattingnow initialize their members with the concrete values those defaults pointed at, so behaviour is unchanged - (!) feat: a quantity kind admits every character. A kind spans its whole quantity tree
(the kind of
isq::speedholds the scalarisq::speedand the vectorisq::velocityalike), and a simple quantity is of a kind as well, since the specification its unit yields is akind_of<…>. Only the representation can restrict a kind's character, socartesian_vector{3., 4., 0.} * m / sis a vector quantity of the kind ofm / s, and a kind stored indoubleadmits every order.magnitude()exists when the quantity may be a vector or a tensor and its representation can produce a norm, and never on a concrete scalar such asisq::speed - (!) feat:
QuantityOf,QuantityPointOf,QuantitySpecOf, andReferenceOftake a character in place of a quantity specification.QuantityOfandQuantityPointOfhold when the specification admits the character and the representation can fill the slot.QuantitySpecOfandReferenceOfask only the specification, which is howutility::polar_vectorrequires a scalar radius. A specification argument keeps its quantity-tree meaning - (!) refactor:
quantity_spec::characteris deprecated in favour of the character-taking concepts above, since a kind admits every character and a single value can't describe that. It reports the character of a concrete specification and is ill-formed for a kind such askind_of<isq::speed>or the specification ofm / s, where 2.5 reported the tree root's character.quantity::characterandquantity_point::characterexist only as deprecated members with the same rule, so they are ill-formed for every simple quantity such as30.0 * km / h. MSVC up to 19.51 instantiates the initializer of every such member eagerly, so there none of thesecharactermembers exist - (!) refactor:
quantity_spec::dimensionis deprecated in favour ofget_dimension(qs) - feat: the GLM integration models the tuple protocol for
glm::vec. GLM states a vector's length only through its staticlength(), so the plugin maps that ontostd::tuple_sizeand adds the matchingstd::tuple_elementandget<I>. A GLM vector is now structured-bindings friendly, and thepolar_vector/spherical_vectorfacades accept one as a Cartesian source, which previously onlycartesian_vector,blaze::StaticVector, and the Eigen plugin could do - fix: classifying a container of quantities as a representation no longer risks a
constraint-satisfaction cycle.
HasMagnituderejects a magnitude that is itself a quantity before probing scalability, whichquantity's ownoperator*(const Value&, const quantity&)would otherwise turn into a recursive question about the very property being classified - fix: the GLM integration header no longer breaks an
import std;build. Its own GLM includes now precede the standard-library import, since GLM pulls in<cmath>textually and libstdc++ requires every such include to come first - (!) fix:
numerical_value_ref_innow constrains its unit the wayin()andnumerical_value_in()already did. It used to check only that the unit is equivalent, so forquantity f = 50. * Hz;the callf.numerical_value_ref_in(Bq)compiled and handed out the number of a frequency "in becquerel" - (!) refactor: throwing constraints are off unless
MP_UNITS_API_THROWING_CONSTRAINTSis enabled. The headers used to turn them on whenever__cpp_constexpr_exceptionswas at least202411L. Their message is formatted at compile time, which the library does only through {fmt}, so enabling them together withstd::formatnow stops the CMake configure step, and an#errordoes the same for header-only use - fix: the library compiles in a hosted build with exceptions disabled
(
-fno-exceptions). Text-formatting errors,basic_fixed_string::atandinplace_vectorgo throughMP_UNITS_THROW, which aborts without exceptions.throw_policyandsafe_int_throw_policyare provided only when exceptions are enabled, soconstrainedandsafe_intdefault to the terminating policies otherwise. Throwing constraints fall back to plain constraint failures, without the formatted message. A newunit_tests_no_exceptionstarget builds every public header with-fno-exceptions - fix: on GCC, type names in constraint diagnostics no longer end in
; std::string_view = std::basic_string_view<char>. The same suffix could make GCC order a type whose name is a prefix of another's differently from Clang when sorting the terms of a symbolic expression - feat: vector quantity decomposition added. A vector quantity splits into 1D-vector
component quantities through
get<Idx>,std::tuple_size/std::tuple_element, and structured bindings, provided its representation offers element access (a memberget<I>(), aget<I>found by argument-dependent lookup, oroperator[], tried in that order) and states its length throughstd::tuple_size. Declaring the component axes, one per element of the representation, with thecomponent_vectorscustomization point andvector_axesmakes every component a distinct kind, reachable asget<Axis>and rejected in cross-axis arithmetic. The inverse is a component-wise constructor (quantity<flight_velocity[km / h], vec3> v = {fwd, lat, vert}), which checks each argument against the axis declared for its position, so a swapped pair of axis-typed arguments does not compile (a simple quantity fits every axis, as everywhere else in the library, and forfeits that check). Without such a declaration both directions remain available, with each component carrying the whole's kind and positions no longer told apart. The kind is what an undeclared decomposition actually knows: a component belongs to the whole's kind without being the whole, and since a kind now admits every character, the component keeps its vector character all the same - (!) fix:
isq::wave_vectornow roots inangular_repetencyinstead ofrepetency. ISO 80000-3 defines the wave vector both ways (item 3-21 against item 3-22), but ISO 80000-12 item 12-9.1 and the relationk = p/ħrequirek = 2π/λ, so the library sides with item 3-22 - (!) fix:
hep::decay_constantis no longer a child ofhep::frequency. A decay rate describes a stochastic process in which nothing oscillates, mirroring how the ISQ keepsactivityout of the frequency family;hep::hertzno longer measures it - (!) fix:
isq::energyandisq::powerno longer carrynon_negative. Thermodynamic potentials, work done against a force, released heat, and exported electrical power are all negative, so tagging the two roots was wrong and every energy and power inherited the error. P4185 states this forenergyexplicitly. The genuinely non-negative members now carry the tag individually:isq::kinetic_energy,isq::photon_energy,isq::radiant_energy,isq::radiant_flux,isq::work_function,isq::ionization_energy,isq::gap_energy(and through itisq::superconductor_energy_gap),isq::carrier_power,isq::quantizing_distortion_power, andisq::signal_energy_per_binary_digit.isq::latent_heatis deliberately signed, since ISO 80000-5 item 5-6.2 defines it as energy released or absorbed - feat:
possibly_negativecancels thenon_negativea real-scalar child would otherwise inherit from its parent. It is needed where a quantity shares its parent's kind, and therefore its units, but not its domain. ISO 80000-12 item 12-30 is the motivating case: an effective mass is negative near a band maximum, yet it must be expressed in kilograms, and only a quantity of the mass kind may be. Rooting it elsewhere loses the kilogram, so the two properties could not be modeled together before.isq::effective_massnow uses it. The tag andnon_negativeare mutually exclusive - feat: ISO 80000-12 (condensed matter physics) is modeled in the new
mp-units/systems/isq/condensed_matter_physics.h, covering 58 of the standard's 60 items: the crystal lattice, lattice dynamics, electron transport, electronic structure, carrier dynamics, and the magnetic and superconducting transitions. Item 12-2.1 (angular reciprocal lattice vector) is awave_vector, so Bloch's theorem adding it to a wave vector type-checks. The carrier densities of item 12-29 share one kind, because item 12-29.3 relates them across species asn * p == pow<2>(n_i). Item 12-31 (mobility ratio) and item 12-33 (diffusion length) wait for ISO 80000-10 item 10-61 and ISO 80000-9 item 9-39, and item 12-14 (Grüneisen parameter) carries no defining equation until the logarithmic-quantities framework lands. ISO permits negative values for items 12-25, 12-27.1, 12-30, and 12-34, but they still inheritnon_negativefromenergyandmassuntil a signed child of a non-negative parent can be expressed - (!) perf: the ISQ part headers no longer pull in whole neighbouring parts to reach a
handful of definitions.
isq::power,isq::energy_density,isq::mass_density(with itsdensityalias), andisq::speed_of_light_in_vacuum(with itslight_speed_in_vacuumandluminal_speedaliases) moved to the newmp-units/systems/isq/shared_quantities.h, which records the owning ISO 80000 part for each.isq/light_and_radiation.hconsequently includes neitherisq/electromagnetism.hnorisq/mechanics.h, andisq/information_science_and_technology.hincludes neitherisq/mechanics.hnorisq/space_and_time.h. Parsingisq/light_and_radiation.hcosts 51% less on GCC 15 and 52% less on Clang 21,isq/electromagnetism.h15% less, andisq/information_science_and_technology.h31% less;isq.hitself stays within 2% of its old cost, since it still defines everything. Every spelling is unchanged andisq.hstill provides them all, but a translation unit that included one part header and reached a neighbouring part's quantity transitively now has to include that part itself.isq::energy_densityis now defined over base quantities rather than asenergy / volume, because its children are reached by unrelated equations (ISO 80000-8 item 8-7 gives sound energy density as ½ρu² + ½p²/(ρc²)); every equation form still converts - feat:
isq::number_of_entities(ISO 80000-9 item 9-1) is the shared root for every count of discrete entities. A count is a kind of its own, so it does not mix with plain dimensionless ratios.isq::photon_numberis now anis_kindchild of it: counts of photons do not mix with counts of other entities, while every count remains reachable from the shared root in generic code. The root opens the newmp-units/systems/isq/shared_quantities.hheader, which holds the parents shared by quantities of more than one ISO 80000 part for the case when those parts must not depend on each other - feat:
isq::energy_densityis the shared root for the energy densities of ISO 80000 parts 6, 7, and 8.isq::electromagnetic_energy_densityandisq::radiant_energy_densityare now its children, so they compare and convert through their common parent - fix:
get_dimension()andget_kind()on a derived quantity spec were not normalized when a base dimension was contributed by three or more factors, soget_dimension(isq::mass_density * isq::speed * isq::length / isq::dynamic_viscosity)did not equaldimension_one, making the canonical Reynolds equation impossible to write - feat:
mp-units/systems/si/unit_symbols_essential.hprovides the SI unit symbols most code actually writes: every unprefixed symbol (base units, named derived units, and the non-SI units accepted for use with the SI) plus the prefixed spellings that are standard practice in some domain —fmandnmin physics,nsin electronics,hPain meteorology,MPain materials,kHz…THzin signals, thepF…mFcapacitor andmΩ…GΩresistor decades,µSvin radiation protection, and so on. The fullunit_symbols.hincludes it and adds the rest of the 24-prefix matrix, so both spell the very same types and may be mixed freely. 218 of the 771 spellings cost about a quarter of what all 771 do, because every prefixed symbol is a distinct type instantiated at parse time.si/core.hnow includes the essential header - perf:
prefixed_unitderives fromdetail::scaled_unit_impldirectly instead of reaching it throughscaled_unit<M, U>::_base_type_. The base class is unchanged — it just no longer instantiates thescaled_unitspecialization to name it, which is a quarter of the cost of every prefixed symbol. Asi/unit_symbols.htranslation unit drops 7.2% of its template instantiations, andsi.h6.5% - feat: unary minus on a unit magnitude (
-mag_ratio<N, D>,-mag<N>), which reads the way a published table prints a negative constant. It yields the same type as putting the sign in the numerator, and a second negation cancels - fix:
uncertain<T>::relative_uncertainty()now divides by the absolute value. GUM and the VIM define the relative standard uncertainty asu(x)/|x|, so it is never negative; it used to come out negative for a negative central value - feat: compile-time factorization now handles composites of large primes:
mul_moduses a double-wide (128-bit) product where the compiler provides one, andfind_first_factorfinds factors with a batched-Brent Pollard's rho instead of unbounded trial division (which needed ~266kconstexpriterations for real CODATA mantissas, over GCC's default loop limit). Mirrors the approach validated in Au (aurora-opensource/au#686); trial division remains as the last-resort fallback - perf: the whole
unit_magnitudeinterface (operators and all queries) moved to hidden friends of a new non-templateunit_magnitude_interfacebase, the same shape asunit_interfaceandquantity_spec_interface. A hidden friend of a class template is redeclared by every specialization, and magnitude-heavy code instantiates thousands of specializations per translation unit, so those declarations dominated compile times; in a non-template base they are declared once and cost nothing while keeping all hidden-friend benefits. A TU includingsiunits and constants dropped from ~2.6 s to ~1.6 s, and the completecodata2022.hfrom ~40 s to ~4.1 s (GCC 15; Clang 21 shows 44 s -> 6.8 s) - perf: the same interface-base treatment applied to the three remaining class templates
that host hidden friends and are instantiated many times per translation unit:
basic_fixed_string(10 friends, ~22 specializations in any TU that includes a system header, 98 for the full CODATA set),symbol_text(3 friends), and the two vector-componentget()overloads onquantity(which cost 2 declarations perquantityspecialization — 476 in a unit-composition-heavy TU). Declarations drop 2.1–3.3% of all function declarations per TU. Template instantiations are unchanged by construction: this is declaration cost, which no instantiation count can see - perf: three compile-time costs of this release's framework extensions trimmed where the
work was redundant. The sort predicates behind every quantity-spec and unit product
compare type names with
string_view::compareinstead of the comparison operators, whose overload resolution probed thestd::error_codeconverting constructors on each call: anisq.humbrella translation unit evaluates about 24 % fewer constant expressions (Clang 23, C++26). The kinds-per-factor test of the spec operators is a variable template rather than a concept, because at-std=c++26a concept's folds are normalized per operand (P2963) and re-evaluated theQuantitySpecatoms of every operand on every product. The component-wisequantityconstructor orders its constraint cheapest-first, so the{value, reference}construction behind42 * mno longer runs the decomposition checks of every new quantity type - perf: four more cuts found by the same attribution.
Unit,QuantitySpec,DimensionandPointOrigincheck their base withis_base_of_v(one atom instead ofderived_from's two) and fold theSymbolicConstanttraits into one atom: theisq.humbrella evaluates 12 % fewer constant expressions.type_list_sizeis a variable template specialization, so no class is instantiated per list (698 fewer instantiations in that umbrella). The framework reads_character_and_dimension_directly where it already holds the type instead of instantiating an accessor per type (651 fewer).prefixed_unitcarries the two members ofscaled_unit_implitself instead of deriving from it, one class instantiation fewer for each of the ~670 prefixed symbols ofsi/unit_symbols.h - perf:
type_list_element,type_list_splitandtype_list_extractuse the__type_pack_elementbuiltin where the compiler provides it (Clang, GCC 14 and later), the C++20/23 counterpart of the C++26 pack-indexing path. The indexed multiple-inheritance trick they used costs three class instantiations per list on every spec or unit product; theisq.humbrella drops 6.7 % of its instantiations and 14 % of its constant evaluations at C++23. GCC 12, GCC 13 and MSVC keep the trick. The factor ordering predicate of quantity specs is an expression rather than a function, one instantiation fewer per pair of factors compared - perf: the first 100 primes that magnitude factorization starts from are a literal table. Computing them with a probable-prime test per candidate cost about 30 ms of constant evaluation in every translation unit that includes a system header, which charged even a TU that includes only the core and defines nothing
- perf:
RepresentationOfmatches the character inside a requires-expression behind its two guards, anddisable_representationrejects aquantityor aquantity_pointby a pattern-matched specialization. Clang substitutes the template arguments of every atom of a constraint whether it evaluates the atom or not, so a rejected type still hadrepresentable_character<T>instantiated for it, which evaluatesScalar,VectorandTensoron the type:RepresentationOfon a point went from 2,707 constraint checks to 262. Measured on the benchmark corpus with no loss on any workflow; a wider rewrite of the operators'Valueoverloads around the same finding was measured as mixed on the gate and not kept - fix:
basic_fixed_string::swapnever compiled — it called an undeclaredswap_rangesthroughbegin()/end(), which yieldconst_iteratorand cannot be written through. Nothing called it, so it was never instantiated. It now exchanges the contents element-wise, and both it and the freeswapare covered by tests - (!) fix: the free
swapforbasic_fixed_stringis now a hidden friend, so it is found only by ADL.mp_units::swap(a, b)no longer compiles; that spelling defeated theusing std::swap; swap(a, b);customization mechanism and was never correct - fix:
symbol_textcomparison against a rawcharor string literal (sym == 'b',unit._symbol_ == "km") is preserved explicitly. It previously worked as a side effect of the comparison operators being members of the class template, which let the other operand reach them throughsymbol_text's converting constructors - (!) feat:
piandπis now a unit constant - (!) feat:
iau::newtonian_constant_of_gravitationis now imported fromcodata::newtonian_constant_of_gravitationinstead of being defined by the IAU system, and theiau::codata2018inline namespace is gone. IAU 2015 Resolution B3 asks for the current best estimate of G, so the value now follows whichever adjustment is current. The value is unchanged today, since CODATA 2022 kept G at 6.674 30(15)e-11 - feat: CODATA fundamental physical constants added as a separate system with one
namespace and one header per adjustment (
codata::codata2014,codata::codata2018, and theinlinecodata::codata2022), GENERATED from the NIST "allascii" tables byscripts/codata_constants.pyfor complete coverage (~230 constants per adjustment): measured constants transcribe the published value and absolute standard uncertainty digit for digit, exact non-terminating values are defined by their exact symbolic relations, and an independent verification step recomputes every emitted value against its source row. Each adjustment ships in two tiers:mp-units/systems/codata/codataYYYY_essential.h(the NIST "frequently used" selection, cheap to compile) andmp-units/systems/codata/codataYYYY.h(the complete table, including the essential tier), withmp-units/systems/codata.has the umbrella. Deliberately not part ofsi, so thatmp-units/systems/si.hdoes not carry constants most code never names (#820) - deprecated:
si::standard_gravity. It is not an SI defining constant but a conventional value adopted by CGPM 3 (1901), which is what NIST's "adopted values" CODATA category holds; its home is nowcodata::standard_gravityfrom<mp-units/systems/codata/adopted_values.h>, a single adjustment-invariant entity shared by all CODATA namespaces (as are the standard atmosphere, the standard-state pressure, and the conventional Josephson and von Klitzing values).yard_pound'spound_forceis now defined through the codata entity - deprecated:
si::reduced_planck_constant. ℏ is not an SI defining constant either; its home iscodata::reduced_planck_constant, defined as the exacth / 2πrelation in the post-2019 adjustments and as the measured "Planck constant over 2 pi" incodata2014 - deprecated:
si::magnetic_constant. The pre-2019 SI defined the ampere through it, which made it exactly 4pi1e-7 H/m; since the redefinition it is measured. Its value is unchanged, but usecodata::magnetic_constantfor the current adjustment, orcodata::codata2014::magnetic_constantfor the exact pre-2019 one. These are NOT interchangeable with thehepconstants of the same name, which belong to a different system of quantities - deprecated:
implicitly_convertible,explicitly_convertibleandcastableinmp_units. They are not proposed for standardization and have moved tomp_units::utility. ADL doesn't find them there, so qualify the call:utility::implicitly_convertible(isq::width, isq::length). A generic interface should constrain withQuantityOforQuantityPointOfinstead - (!) refactor:
pi_c, the magnitude constant behind thepiunit, is an implementation detail now. Use thepiunit instead, e.g.,pi * metrerather thanmag<pi_c> * metre - fix:
pow()of a dimension, a quantity specification, or a unit with a negative exponent (e.g.,pow<-1>(metre)) failed to compile and now yields the inverted expression - (!) refactor: a quantity equation keeps a kind per factor. A kind operand becomes a kind
factor of the result and a typed operand stays typed.
kind_of<isq::length> / isq::durationis nowderived_quantity_spec<kind_of_<isq::length>, per<isq::duration>>rather thanisq::length / isq::duration, so42 * m / isq::duration(2 * s)converts implicitly to a child ofisq::speeddefined overisq::height, which it couldn't before. A result whose factors are all kinds is a kind as before. A kind factor and a typed factor of one tree stay separate, soisq::duration(2 * s) / (1 * s)is a ratio of two durations rather thandimensionless, and still converts to it implicitly - (!) refactor:
inverse()of a dimension, a quantity specification, or a unit is now a hidden friend, likepow(),sqrt(), andcbrt(). An unqualified call works as before, butmp_units::inverse(m)no longer compiles and needs the qualification dropped - (!) refactor: the
std-format-spechelpers that formatters are written against (fmt_align,fill_t,fmt_arg_ref,fill_align_width_format_specs,parse_align,parse_dynamic_spec,parse_fill_align_width,parse_nonnegative_int,handle_dynamic_spec,width_checker,write_padded,at_most_one_of) moved frommp_units::detailto the publicmp_units::utilitynamespace and now ship frommp-units/utility/format.h;mp-units/bits/fmt.handmp-units/bits/format.hare gone - feat: C++26 contracts support added (
contracts=stdConan option /MP_UNITS_API_CONTRACTS=STDCMake option); experimental, requires GCC 16 with-fcontracts(#682) - feat:
MP_UNITS_PRECONDITION,MP_UNITS_PRECONDITION_DEBUG,MP_UNITS_PRE,MP_UNITS_POST,MP_UNITS_PRE_BODY, andMP_UNITS_PRE_BODY_DEBUGcompatibility macros added;MP_UNITS_EXPECTS*are now GSL-backends-only (unchanged there, no-op under C++26 contracts) (#682) - feat:
contracts=stdmay be combined withimport_std(the GSL-era restriction applied only to third-party library headers) (#682) - feat:
contracts=stdmay be combined withfreestanding; the application has to provide a contract-violation handler or compile with an evaluation semantic that does not call one (e.g.quick_enforce) (#682) - fix:
INTMAX_MAXmacro replaced withstd::numeric_limits<std::intmax_t>::max()in contract predicates (the macro is unavailable withimport std;) - (!) feat: natural units reworked from scratch
- (!) feat: IAU system definition improved
- feat:
uncertain<T>representation type added tomp-units::utility(first-order uncertainty propagation for independent values) (#464) - feat: measured constants may now declare their standard uncertainty in the form their
source publishes it (exact metadata on
named_constant):standard_uncertainty(absolute, in the constant's own dimension, transcribing the CODATA table row verbatim) orrelative_standard_uncertainty(unit-invariant, for constants whose defining unit is not tabulated);MeasuredConstantconcept,get_standard_uncertainty,get_relative_standard_uncertainty, andmeasurement_ofadded, with each accessor deriving the undeclared form on demand; declared foriau::newtonian_constant_of_gravitationand all measured constants in the threehepCODATA namespaces (#464, #820) - feat: unit conversion factors built from measured constants carry their relative standard
uncertainty; the conversion engine folds it into representation types that opt in
via
fold_conversion_uncertainty(e.g.,uncertain<T>), with measured constants shared by both units canceling symbolically; exact representation types are unaffected (#464) - feat:
uncertain<T>gained the concise output notation of ISO 80000-1:2022, 7.2.4, selected by appending~to itsformat-spec(23.4782(32));precisionstates the number of significant digits of the uncertainty (two by default, as published by CODATA), and thevalue ± σform remains the default (#464) - feat: comparisons against literal
0 - feat:
hepsystem refactored to be similar to leading projects in the HEP domain - feat:
hepsystem extended with new constants and specialized quantities - feat:
unit_for,reference_for, andrep_foradded - feat: linear algebra integrations added (headers
mp-units/integrations/{eigen,glm,blaze}.hand modulesmp_units.integrations.{eigen,glm,blaze}) so Eigen, GLM, and Blaze vectors and matrices can be used directly as quantity representations - feat:
integration_{eigen,glm,blaze}Conan options /MP_UNITS_BUILD_INTEGRATION_{EIGEN,GLM,BLAZE}CMake options added to skip an integration whose library is installed but does not build with the toolchain in use (#843) - feat:
representation_canonical_typecustomization point added (materializes expression-template representations before storing them in aquantity) - feat: quantity character split into two orthogonal axes,
quantity_tensor_order(scalar, vector, tensor) andquantity_field(real, complex), so complex vectors and tensors are now expressible - feat:
cartesian_tensorbuilt-in representation type added (fixed 3×3 second-order Cartesian tensor with the ISO 80000-2 second-order operations) - feat:
numeric_fieldandtensor_ordercustomization points added (adapter-overridable traits that report a representation's field and order) - feat: type conversions improved to raise compile-time warnings on truncation
- feat:
natural_point_origin<QuantitySpec>added (replaceszeroth_point_origin<QuantitySpec>) - feat:
is_natural_point_origin<T>added (replacesis_zeroth_point_origin<T>) - feat: range-validated quantity points added (the bounds policy of an origin, such as
check_in_rangeorwrap_to_range, is enforced on construction from a value, on unit and origin conversion, and in arithmetic) - feat: the bounds of a relative origin are checked at compile time to nest within those of its nearest bounded ancestor
- feat: a bounds policy with
bool operator()(const V& v) constis a checking policy and one withV operator()(V v) constis an adjusting policy (a value a checking policy rejects goes toconstraint_violation_handler<Rep>, and without one it violates the precondition of the operation storing it) - feat:
exclusive_bound{q}added to exclude an end from the range of a bounds policy (accepted bycheck_in_rangeat either end and bywrap_to_rangeat its max) - feat: each bound of a bounds policy must be exactly representable in the quantity type of a point checked against it, and so must the offset to a bounded ancestor for a point with a representation that is not floating-point
- feat: a point that breaks that rule is not constructible from a quantity and offers no
is_within_boundsortry_make(afloatpoint needsfloatbounds: thedoublevalue of0.1isn't afloatvalue) - feat:
min()andmax()of a point whose origin has no bounds of its own report the bounds of its nearest bounded ancestor in the point's frame (with a floating-point representation, the extreme values those bounds accept after rounding) - fix:
==and<=>between points of different origins are offered only when the translation their bodies perform compiles (aconstrainedrepresentation has no arithmetic with a plain origin offset) - feat: the static member functions
QP::is_within_bounds(q, origin)andQP::try_make(q, origin)added for points with a checking policy or without bounds (try_makereturnsstd::expected<QP, bounds_violation>) - feat:
quantity_from_unit_zero()member function added (replacesquantity_from_zero()) - feat:
numerical_value_in(Unit)andforce_numerical_value_in(Unit)member functions added toquantity_point(extract the raw value of a default-origin point; the inverse ofpoint<Unit>(value)) (#813) - (!) feat: rounding policies (
truncated,rounded,rounded_down,rounded_up) added for truncating conversions; passed as the last argument ofin(),numerical_value_in(), andvalue_cast()(#534) - (!) refactor:
force_in()andforce_numerical_value_in()deprecated (usein()andnumerical_value_in()with a rounding policy, e.g.truncated) (#534) - (!) fix: truncating conversions by an irrational factor (e.g.
rad->deg) now round negative values towards zero, consistently with the rational-factor conversions (previously they rounded towards negative infinity) - (!) fix:
quantity_point::min()/max()now report a range bound as the point's own quantity type, so a bound declared in a different unit or representation is no longer truncated (e.g. a1500 * mbound on akm-based point reported1 km, below the declared minimum) - feat:
fahrenheit_zeropoint origin added (replaceszeroth_degree_Fahrenheit) - feat: dimensionless quantities with unit one can now be created with
quantity_spec::op(Val)explicit conversions - feat: explicit construction from number enabled for
dimensionlesssubkinds - feat: quantity hierarchies improved
- feat:
dim_angletext symbol changed toα - feat: missing unit symbols added for cases where the unit and symbol have the same identifier
- feat:
leaguesymbol set tolea - feat:
si2019namespace made inline - feat: typographic system extended
- feat: astronomy system added
- feat: explicit
quantity_specconversions added forquantity_point - (!) refactor:
pimagnitude constant renamed topi_c - (!) refactor:
internationalsystem renamed toyard_pound - (!) refactor:
zeroth_point_origin<QuantitySpec>deprecated (usenatural_point_origin<QuantitySpec>) - (!) refactor:
is_zeroth_point_origin<T>deprecated (useis_natural_point_origin<T>) - (!) refactor:
quantity_from_zero()deprecated (usequantity_from_unit_zero()) - (!) refactor:
zeroth_kelvindeprecated (useabsolute_zero) - (!) refactor:
zeroth_degree_Celsiusdeprecated (useice_point) - (!) refactor:
zeroth_degree_Fahrenheitdeprecated (usefahrenheit_zero) - (!) refactor:
zeroth_rankinedeprecated (usesi::absolute_zero) - refactor: CGS <-> SI interop improved with using declarations
- refactor:
isq::timeswapped withisq::duration - refactor: deprecation warnings now include the release version
- refactor: representation concepts cleanup
- (!) refactor: the flat
quantity_characterenumeration (real_scalar,complex_scalar,vector,tensor) deprecated; use thequantity_tensor_orderandquantity_fieldaxes - (!) refactor: representation character derived from intrinsic, adapter-overridable
tensor_orderandnumeric_fieldtraits plus a singledisable_representationopt-out (replacing the previousis_*/disable_*flags and theNotQuantityconcept) - refactor:
quantity_speccall operator constraints improved - refactor:
quantity_castconstraints improved - refactor:
[[nodiscard]]applied to the constructors of all library value types (quantity,quantity_point,cartesian_vector,cartesian_tensor,polar_vector,spherical_vector,safe_int,constrained,fixed_string, andsymbol_text) (#234) - fix: fixed-point arithmetic for integer unit conversions (#764, based on original work by @burnpanck in #580)
- fix: overflow-safe cross-unit integer comparisons using double-width arithmetic (#766, based on original work by @burnpanck in #580)
- fix: dimensionless quantities truncation prevention fixed
- fix: clang-18 workaround for pragmas not working in a C++ module build
- fix:
normal_stressandshear_stressfixed to havestressas a parent - fix:
mechanical_energyrequires a very generic equation that overrides the one frommechanical_work - fix:
fathomdefinition fixed and moved toyard_poundsystem - fix:
quantity_castsupport fixed forquantity_point - fix:
quantity::magnitude()extended to tensor quantities and complex fields (Hermitian and Frobenius norms); vector decomposition (get) now works for complex vectors - test: multiply syntax unit tests added
- test:
gravitational_potential_energydefinition updated to match ISQ - test:
fathomtest moved toyard_pound - build: deprecation comments added to CMake file for
format.handostream.h - ci:
build_policyand CI detection support added tocheck_all.sh - ci: environment tests moved to
validate_environment.shscript - ci: CI build matrix generated dynamically from a Python script (#767, based on original work by @burnpanck in #637)
- ci: toolchain feature support thresholds derived from
conanfile.pyvia AST to eliminate duplication between the Python script and the Conan recipe - ci:
generate-matrix-summary.pyadded to write a Markdown build matrix table and per-value coverage statistics toGITHUB_STEP_SUMMARY - chore:
site/subdirectory added to.gitignore - chore: persistency for conan and pipx packages added to devcontainer
- docs: systems reference documentation generator added
- docs: HEP system description added
- docs: "Safety Features" chapter added
- docs: "Yard-Pound Systems" chapter added
- docs: IAU and astronomy systems documentation added
- docs: ISQ, SI, and CGS systems documentation added
- docs: "Using Custom Representation Types" chapter added
- docs: "Character of a Quantity" chapter updated for the two-axis (order and field) model
- docs: "Pure Dimensional Analysis" chapter added
- docs: How-to Guides improved
- docs: "Creating distinct quantity kinds with
is_kind" chapter added - docs: "Strongly-Typed Counts" workshop added
- docs: incremental migration workshop added
- docs: workshops restructured into subdirectories
- docs: "New Systems Documentation Generator" blog post added
- docs: interactive learning blog post added
- docs: quantity hierarchies added to User's Guide
- docs: multiple new workshops added (tutorials 9–12)
- docs: "Type Safety in Practice" chapter updated
- docs: IEC 80000 renamed to IEC in documentation
- docs: "Use Cases" renamed to "How-to Guides"
- docs: "Obtaining Metadata" renamed to "Type Introspection"
- docs: documentation TOC restructured
- docs: total_energy example added
- docs: "AI-Generated Contributions" chapter added to CONTRIBUTING
2.5.0 December 24, 2025¶
- (!) feat: representation concepts improved
- (!) feat:
representation_ofconcept now also accepts aquantity_specand accepts any representation character for quantity kinds - (!) feat:
quantity::one()removed - (!) feat:
Representationconcept removed - feat:
SymbolicArgapplied to expression templates - feat:
perandpowermadefinal - feat:
derived_XXXare now constrained withSymbolicConstant - feat: prime factorization extended to any magnitude (thanks @chiphogg)
- feat:
cartesian_vectoradded - feat:
equivalentnow accept any units (even non-convertible) - feat: text output should fallback to the portable mode when UTF-8 is not used for
text_encoding - feat: precondition added to
to_u8string - feat: text output of scaled units is now enclosed in parenthesis
(...)instead of brackets[...] - feat:
abs(quantity)exposed for conforming freestanding implementations - feat: proper constraints for
kind_of - feat: missing precondition added for
quantity::op/ - feat:
quantity_specconversions improved - feat:
rankineunit added - feat:
std::numeric_limitssupport added - feat:
scaling_overflows_non_zero_valuesadded to detect conversions overflowingrep - feat: deprecation messages now provide the release version where the deprecation happened
- feat: electromagnetism.h updated to IEC80000-6-2022 with raw numbers
- feat:
lerpandmidpointfor points added - feat:
is_value_preservingcustomization point added - feat:
EQUIV{...}replaced with[...]in the text output of common units - feat:
constexpr_formatadded - feat:
unsatisfiedadded and enabled throwing constraints - feat: some constraints refactored to throw exceptions with nice error messages
- feat: explicit constructor now can perform an explicit
quantity_specconversion - feat: natural units support is now opt-in
- feat:
value_type_tis now recursive - feat: support for
rootof negative numbers removed - feat: old MSVC workarounds disabled for the latest version
- feat:
invoke_with_prefixedadded to SI - feat:
QuantityLikeshould not satisfy theRepresentationconcept - feat(example):
is_vectorspecialization no longer needed forsi_constants - feat(example): measurement.h extracted for easier reuse
- feat(example):
clcpp_responseandconversion_factorexamples removed - (!) refactor:
type_listmoved to implementation details - (!) refactor: from now
unit_symbolanddimension_symbolalways returnsstd::string_view - (!) refactor:
text_encodingrenamed tocharacter_set - (!) refactor:
Magnituderenamed toUnitMagnitudeandmagnitudetounit_magnitude - (!) refactor:
unit_magnitudemoved todetailnamespace - (!) refactor:
absoluterenamed topoint - (!) refactor:
powermembers refactored to be explicitly exposition only - (!) refactor:
is_XXXcustomization points for representation types removed - (!) refactor:
quantity_valuesrenamed to representation values - (!) refactor:
scalarandcomplexcharacters renamed toreal_scalarandcomplex_scalarrespectively + concepts refactoring - (!) refactor:
MagConstantconcept renamed todetail::is_mag_constantvariable trait - (!) refactor:
format.hheader file made deprecated - (!) refactor:
ostream.hheader file made deprecated - (!) refactor: rename
default_denominatortodefault_solidusinunit_symbol_solidusenum - refactor: mp_units.core defined in terms of
core.h - refactor:
MP_UNITS_NONCONST_TYPEintroduced to benefit from the C++23 feature - refactor:
SymbolicConstantconcept refactored - refactor: explicit type of
op/forquantityandreferencereplaced with constrained placeholder - refactor: private
unit_magnitudeinterface renamed to not use leading_ - refactor:
one_ofconcept removed and replaced withQSPropertyinquantity_spec - refactor:
std::is_trivialwill be deprecated in C++26 - refactor:
SameQuantitySpecconcept removed and replaced with direct comparison - refactor: unused
SameReferenceconcept removed - refactor:
type_name_lessintroduced and used as a default predicate for expression templates - refactor: "expression templates" renamed to "symbolic expressions"
- refactor:
all_are_kindsremoved andget_associated_quantitysimplified - refactor:
referencenow returns explicit types forinverse,pow,sqrt, andcbrt - refactor: repeated concept checks removed from
get_common_reference - refactor:
std::assignable_fromused inValuePreservingToconcept - refactor:
quantityconstructor refactored to use another constructor with the result ofsudo_cast - refactor: preconditions for quantity operations now use
is_neq_zero - refactor: implicit expression variations used in
quantityandquantity_pointconstraints - refactor:
inverse()constraints improved - refactor:
make_quantity_pointintroduced - refactor:
point_origin_interface::op+return type unified with the rest of the interfaces - refactor:
std::convertible_toreplaced withstd::same_asinbasic_fixed_string - refactor:
less,ceil, androundrefactored and improved + more unit tests forround - refactor:
math_concepts.hremoved and concepts replaced with explicit expression in constraints - refactor:
visit_format_argis deprecated in C++26 - refactor: deprecated literal operators
- refactor: constraints refactoring
- refactor: compund assignment and pre-/post-increment operators are now lvalue-qualified member functions
- refactor:
ValuePreservingScalingconcepts renamed - refactor:
common_typespecializations refactored - refactor:
NumberLikerenamed toDimensionlessOne - refactor: branching on a deprecated C++ feature improved
- refactor: all CTADs made implicit
- refactor:
MP_UNITS_REMOVE_CONSTgcc workaround added toRepresentationOf - refactor:
ReferenceOfconcept simplified - refactor: explicitly defaulted special member functions removed
- refactor(example): slight refactoring of examples while working on their documentation
- refactor(example): kalman filter examples refactored to better match their
- refactor(example):
is_haefunction refactored toHAEAltitudeconcept - (!) fix:
electric_current_phasor,voltage_phasor,apparent_powerswitched to complex character - (!) fix:
position_vectoranddisplacementmoved to a different place in a tree - (!) fix:
velocityis now defined in terms ofdisplacementinstead ofposition_vector - fix: missing
core.hadded to CMake - fix:
constwas leaking to someSymbolicConstants - fix:
make_referenceshould skip only the exact kinds deduced from a unit - fix: inconsistencies in
get_common_quantity_spec()fixed - fix: unused
convertible_kinds()argument removed - fix: compile-time branch condition fixed in
quantity_point::point_for - fix:
inverse(Quantity)fixed for subkinds ofdimensionless - fix:
point_origin_interface::op+constraints fixed - fix: missing
get_common_unit()overload added - fix:
floorandceilconstraints fixed - fix: quantity characters fixed in electromagnetism quantities
- fix:
arg.visitsupport fixed - fix:
expr_lessnow also sorts powers - fix:
mag_constantworkarounds branches for clang fixed - fix: checking for clang versions fixed in CMake scripts
- fix: text stripping in
type_namefixed - fix: make quantity conversion to
Repconstexpr(thanks @KangarooKoala) - fix: MSVC compilation fixed
- fix:
absinterface and implementation improved - fix: unused parameters removed from
scaling_overflows_non_zero_values - fix: invalid precondition check in
rootremoved - fix: workaround for fmt
- fix: CTAD issue workaround for MSVC
- fix:
dynamic_spec_id_handlerfixed for gcc-15 - fix: MSVC workarounds for
constevalfunctions - fix: resolve CMake compiler test failure in freestanding CI builds (thanks @rothmichaels)
- fix: msvc empty bases workaround (thanks @Radnyx)
- fix: seconds literal has unspecified type and depends on implementation (thanks @Radnyx)
- fix:
named_unitcan now be created forkind_of<dimensionless> - fix: enable runtime usage of inverse function by using compile-time unit extraction (thanks @rothmichaels)
- fix: CTAD for dimensionless quantities fixed
- fix: concepts tests compilation fixed for
MP_UNITS_API_NATURAL_UNITSOFF - fix: missing natural units support added to
package_info() - fix: freestanding build error in Conan
package_info()(thanks @kammce) - fix: replace
wstring_viewwithbasic_string_view<wchar_t>(thanks @kammce) - Fix destination unit creation in
inverse - fix(docs): typo in a file name fixed
- fix(example): text formatting fixed for
glide_computerdocumentation - test: lots of tests for complex quantities
- test: runtime unit tests refactored to have a bigger granularity (less top level tests)
- test: surface tension replaced with entropy in an fmt test
- test: test_package now is tested also with C++20 modules
- test: tests for dimensionless quantities static data members
- test: a few more natural units tests added
- test: tests to check if
quantitysatisfiesScalar - test: add static tests for concept
DimensionOf(thanks @jvocht) - test: quantity character concepts tests for quantities added
- test: duplicated
dimensionlesstests removed - test: additional concepts tests for quantity spec added
- docs: ISQ part 6 released
- docs: new chapter about our documentation added to the contributing guide
- docs: directory name updated in the contributing guide
- docs: mp-units Conan options added to conanfile.txt examples
- docs:
contractsConan option default value description improved - docs: outdated note removed from the "Text Output" chapter
- docs: a paragraph about additional formatting options removed (applicable only to quantity symbols which we do not support)
- docs: Wrocław 2024 meeting report
- docs: explicit unit conversion example added to the "Symbols of common units" chapter
- docs: "Bringing Quantity-Safety To The Next Level" blog post added
- docs: quantity-safety mentioned in the docs
- docs:
complexcharacter added to the "Quantity character" chapter - docs: intro to "Value Conversions" chapter added
- docs: "Scaling overflow prevention" chapter added
- docs: "Concepts" chapter updated
- docs: old customization points removed from the "Character of a Quantity" chapter
- docs: clang-19 issues mentioned in a compiler support table
- docs: "Introducing absolute quantities" blog post added
- docs: relative path removed from the contributing guide
- docs: examples updated and deprecated tags generation replaced with modern usage
- docs: compiler explorer links replaced with buttons
- docs: "Installation and Usage" cleanup
- docs: "Introduction" chapter improved
- docs: "Quick Start" Improved
- docs: "Interface Introduction" improved
- docs: "Systems of Quantities" chapter improved
- docs: "Concepts" chapter improved
- docs: README updated
- docs: "Install as a Dependency" added to README
- docs: tutorials section added
- docs: info about
kind_of<dimensionless>units added - docs: adjust formatting in temperature printing function for better alignment
- docs: README visually improved
- docs: 2 new chapters added to README
- docs: link to mp-units in ConanCenter added to README
- docs: "Support the Project" added to README
- docs: enhance testimonials section for clarity and inclusivity
- docs: clarify flowchart labels for quantity addition and differences
- docs: CONTRIBUTORS.md added
- docs: examples reworked
- docs: "Cheat Sheet" added
- docs: "Auto-scaling of a quantity" chapter added
- docs(ref): document most of
mp_units.core(thanks @JohelEGP) - build:
CheckCacheVarValuesCMake module file added - build:
MP_UNITS_DEV_TIME_TRACECMake option added - build:
MP_UNITS_API_NO_CRTPremoved fromtest_packageCMake - build: require at least CMake 3.31 with Conan
- build: clang-20 enabled in CI
- build: clang-19 support removed from conanfile.py
- build: clang-20.1 workaround added to
package_info - build: update dependencies to gsl-lite/1.0.1, ms-gsl/4.2.0, fmt/12.1.0, catch2/3.11.0, cmake/4.2.1
- build: suppress warnings for gcc-12 in conanfile
- build: switch freestanding CI to clang-20
- build: gcc installation step is now mandatory for all gcc versions
- build:
import_stdset toFalseby default - build:
wg21-linear_algebradependency removed - build:
check_libcxx_in_useimproved - build: Gitpod support removed
- build: CodeSpaces support added
- build: CMake switched to a new gsl-lite target
- build: clang-21 added to
check_all.sh - build: gcc-15 enabled in
check_all.sh - build:
explicit_thisenabled for AppleClang 17 and MSVC 19.32 (thanks @alex-tee) - build: add
build: add INSTALL option to cmakeoption to cmake (thanks @alex-tee) - build: projectPrefix CMake variable removed
- build:
MP_UNITS_BUILD_AS_SYSTEM_HEADERSremoved - build:
warnings.cmakerefactored to useCMAKE_COMPILE_WARNING_AS_ERROR - build:
CMAKE_COMPILE_WARNING_AS_ERRORset in conanfile - build:
PROJECT_IS_TOP_LEVELused inensure_entry_point - build: Various cleanup (thanks @HazardyKnusperkeks)
- build: CMake config file variables handling fixed
- build: dereferencing CMake variables in
if()conditions is not needed - build: improved setting of
MP_UNITS_BUILD_CXX_MODULESfortest_package - build:
MP_UNITS_BUILD_CXX_MODULESwill now be always provided by Conan - build: CMake CI should run the cmake executable provided by Conan
- build: C++23 enabled for
test_packagewhenimport stdis ON - build: all
target_compile_definitionsaggregated in one place - ci: CI matrix generation added (thanks @burnpanck)
- ci:
import_stdnow checks if at least C++23 is being used - ci: GitHub actions improved
- ci: dependency review GitHub action added
- ci: clang-21 support added
- ci: update dependency review configuration
- ci: housekeeping after release step fixed in ci-conan
- ci: the macOS-13 based runner images are retired in GitHub
- ci: old 'VISUAL' decendant of Conan 1.x removed from CMake CI
- perf: caching of the results of heavy
constevalfunctions execution added - perf:
expr_projectableconcept removed to improve compilation performance - style: pre-commit tools updated
- style: markdownlint rules updated
- style: MD036 added to .markdownlint.json
- chore: add issue templates for bug reports, documentation issues, and feature requests
- chore: add usage experience issue template and a chapter in README
- chore: PR template added
- chore: FUNDING.yml file added
2.4.0 November 5, 2024¶
- (!) feat:
phase_velocityandgroup_velocityaliases removed from ISQ by ISO - feat:
iec::bitusing-declared iniec::unit_symbols - feat: common unit symbols now use
EQUIV{u1, u2, ...}syntax - feat:
scaled_unitsymbol printing improved ([]around the entire unit, small magnitude values do not use a power of10anymore) - feat:
scaled_unitdoes not have a priority overderived_unitanymore - feat: fractional exponents support added to
mag_power - feat: tag types are now required to be empty
- feat: magnitude text now obeys formatting parameters and knows how to print constants
- feat: added support for printing powers of magnitude constants
- feat:
SymbolicConstantconcept added - feat:
common_unitselection algorithm improved to makerev + radreturnrad - feat: litre text symbol changed from
ltoLto avoid ambiguity with1 - feat: alternative litre unit symbol
Ladded to prevent ambiguities with1 - feat: Unicode unit symbols
- feat:
πadded as an alias forpi - feat:
expr_powextended to remove redundancy in callers - feat:
DerivedDimensionExpr,DerivedQuantitySpecExprandDerivedUnitExprremoved - feat:
MagnitudeSpecExprandPowerVBaseremoved and some functions renamed to limit possible ambiguity in overload resolution - feat:
std::is_objectconstraint applied tovalue_type_t - feat:
quantity_valuesare now defined on top ofstd::chrono::duration_values - feat: from now on truncation is not allowed in compound assignment
- feat(example): currency example now uses
chrono::time_pointand has better interfaces - feat(example):
treat_as_floating_pointspecializations for examples' types removed - (!) refactor: all
iecquantity specifications are now deprecated and moved toisq - (!) refactor:
mag_constantnow takes a symbol and a value and the class deriving from it must be final - (!) refactor:
op==(U1, U2)now checks for the same type (old behavior available asequivalent(U1, U2)) +convertiblenow verifies associatedquantity_specas well - (!) refactor:
ascii->portable,unicode->utf8, 'A' -> 'P' - (!) refactor:
char_traitsremoved fromfixed_string - (!) refactor: convertibility traits and concepts refactored to use
boolflags instead of wrappers - (!) refactor: tag types should not expose their members
- refactor:
convertible(U1, U2)implementation simplified - refactor:
absmoved toconstexpr_math.h - refactor:
unit_symbol_implsimplified - refactor:
unit_symbol_formattingmoved to a dedicated header file - refactor:
shorten_Tremoved - refactor: magnitude interface cleanup
- refactor:
derived_from_the_same_base_dimensionno longer needed - refactor:
one_ofusage removed from thefixed_stringdeduction guides - refactor:
quantity.his not needed inconstants.h(unit.his enough) - refactor:
SameDimensionconcept is not needed and can be inlined inDimensionOf - refactor: framework Unicode symbols are now spelled using their codes
- refactor:
QuantitySpecWithNoSpecifiersremoved andkind_ofdefinition simplified - refactor:
treat_as_floating_pointsimplified and extended to usestd::chrono::treat_as_floating_point_v - refactor:
wrapped_type_treusesstd::indirectly_readable_traits - refactor:
expr_fractionstakes directOneTypetype now instead of a trait - refactor: Unicode symbols description reworked based on the latest SG16 recommendations
- refactor:
Mutableconcept applied toquantityandquantity_point - refactor:
explicitcleanup for deduction guides ofquantityandquantity_point - refactor:
point_origin_interface::op-cleanup - refactor:
QuantityLikeImplrefactored to conform to API Reference by @JohelEGP - refactor:
get_complexityrefactored to be 0-based and not account for a number of arguments in a list - refactor:
get_complexityrefactored to returned maximum complexity of an element (instead of the sum of elements) - refactor(test):
derived_quantityrefactored tochild_quantity - fix: missing
are_ingredients_convertibleoverloads added - fix: constraints for magnitude added for
scaled_unitand fixedcommon_unitinstantiating it incorrectly - fix: according to ISO 80000-16
%should always be prefixed with space - fix: extraneous space in unit symbol having only denominators removed
- fix: explicit cast added to
lessfor magnitudes to fix clang-arm64 conversion error - fix:
common_unithandling fixed for some corner cases - fix: math functions constraints fixed
- fix:
operator*(M, U u)fixed forUbeingscaled_unit - fix: subsumption of
QuantityKindSpecfixed - fix:
ValuePreservingTofixed to applystd::remove_cvref_tonFromRep - fix: compound assignment operations on quantities now behave the same as on the underlying representation types
- fix:
QuantityConvertibleToused inquantity_pointcompound assignment - fix:
convertible_kindsimplementation fixed - fix(tests): freestanding build fixed
- test: unit tests for the inverse of
mag_constantadded - test: Unicode symbols used in unit tests
- test: more
std::chronotests added - test: commutativity tests added to ISQ
- test: one
kind_oftest added to reference tests - test:
pow<0>andpow<1>tests added for dimensions - test: more
get_common_quantity_spectests added - build: setting of some test_package CMake options enabled only for a
cxx_modulesbuild - ci:
sudo apt updateadded for documentation.yml in hope that it will resolve missing system packages issue - ci: MSVC added to the CI
- ci: the latest not-released docs will use "HEAD" as a version from now on
- ci: documentation action should run on a new tag as well
- ci: documentation action limited only to commits that change documentation files
- ci: non-documentation actions should not run on tags
- docs: missing systems added to the "Project Structure" chapter
- docs: graphs of ISQ kind hierarchies improved
- docs: category of the ISO meeting reports changed to "WG21 Updates"
- docs: blog comments support added
- docs: Part 1-5 articles of the ISQ series added
- docs: "Symbols of scaled units" chapter added + minor updates to scaled and common units chapters
- docs: conan profile updated to present gcc-14 instead of gcc-12 which is no longer supported
- docs: "Why derived units order is not preserved from the multiplication?" chapter added to FAQ
- docs: "Many shades of the same unit" extended with a note about the derived units order
- docs: API Reference now presents index.html instead of full.hml
2.3.0 September 27, 2024¶
- (!) feat:
deltaandabsoluteconstruction helpers - (!) feat: Conan and CMake options changed as requested at ConanCenter code review
- (!) feat:
unit_can_be_prefixedremoved - from now on all named units can be prefixed - feat: formatting functions for units and dimensions marked as
constexprto enable compile-time text formatting - feat:
qp1.quantity_from(qp2)added - feat: non-member
swapadded forfixed_string - feat: simplified
inplace_vectoradded - feat: text output for angular units improved (space before symbol removed)
- feat: representation type template parameter added to value conversion functions
- feat: all tags in the expression templates are now ordered by the type names
- feat: convertibility of a quantity with a unit
onewith the raw value added - feat:
import std;support added - feat: compute values for rational magnitude powers (thanks @chiphogg)
- feat:
value_cast<Representation, Unit>()complementary conversion function added - feat:
hw_voltageexample added - feat:
MP_UNITS_IMPORT_STDandMP_UNITS_MODULEShandled properly intest_package.cpp - feat:
complexquantity character added - feat:
iec::varunit added - feat:
type_list_uniqueadded - feat:
for_eachonstd::tupleadded - feat:
common_unitsupport added - (!) refactor:
quantity_point_like_traitsnow use numerical value instead of the quantity - (!) refactor:
iec80000system renamed toiec - (!) refactor:
mag_piis nowmag<pi> - (!) refactor:
common_XXX()functions renamed toget_common_XXX() - refactor: error messages-related improvements
- refactor:
[[nodiscard]]andconstevalset for some magnitude-related functions - refactor: degree Celsius and Fahrenheit symbols text now use Unicode codepoints
- refactor:
dimension_symbolandunits_symbolrefactored to useinplace_vector - refactor:
unit_symbolanddimension_symbolrefactored for readability andconsteval - refactor: binary operators of
quantityandquantity_pointare now hidden friends - refactor: tag types-related operators are now hidden friends as well
- refactor:
ValuePreservingToconcept added - refactor: perfect forwarding interfaces improved
- refactor:
Representationconcepts now requiresWeaklyRegularinstead ofstd::regular - refactor:
quantity_pointdefault-constructibility removed from thequantity_fromconstraints - refactor:
has_common_type_vsimplified - refactor:
is_power_of_quantity_specandis_power_of_dimvariable templates converted to concepts - refactor: unnecessary custom versions of
is_specialization_ofremoved - refactor:
is_derived_from_specialization_of_vadded and applied to remove custom traits - fix: signatures of capacity functions of
fixed_stringfixed - fix:
MP_UNITS_API_NO_CRTPhandling fixed - fix:
MP_UNITS_HOSTEDbranch added tocore.h - fix: mkdocs dependencies fixed in the gitpod dockerfile
- fix:
MP_UNITS_API_CONTRACTSshould have a priority over headers availability - fix:
si.handangular.hnow properly includehacks.hto defineMP_UNITS_HOSTEDbefore its usage - fix: quantity scaling between different prefixes improved
- fix: conversion operator to
std::chronotypes fixed - fix:
std::formatdoes not always useChar*as iterators - fix:
complex_power& co fixed - fix:
__cpp_deleted_functionworkaround for clang-19 added - test: conversion to chrono unit tests added
- test: unit tests for creating a quantity from a
volatilevariable - test: increase tolerance for certain math tests to two epsilon by @burnpanck
- test:
std::complex-based quantities tests added - build: conanfile bumped to use
catch2/3.7.0 - build: conanfile bumped to use
fmt/11.0.1 - build: minimum required CMake version bumped to 3.25
- build: duplicated
cmake_minimum_requiredcommands removed - build: minimum conan version set to 2.0.15
- build: MSVC compilation enabled for the library part by @czjhoppe
- build: Dockerfile updated for gitpod
- build:
generate()intest_packagenow correctly propagates project's options - build:
target_include_directoriesis not needed anymore - build:
target_compile_featuresnow usesCMAKE_CXX_STANDARD - build:
package_typeis dynamically set in conanfile.py depending if we build modules or not - build(conan): packaging improved
- ci: added test for upstream clang on macos-14, as an example for an arm64 platform by @burnpanck
- style: pre-commit updated to clang-format-18.1.8
- docs: "Strong Angular System" chapter added
- docs: docs updated to use new spelling for Conan options
- docs: "Interface Introduction" chapter updated
- docs: St. Louis 2024 report added
- docs: "Radians and degrees support" added
- docs: Rework of "Getting Started" section
- docs: "API Reference" support added (thanks @JohelEGP)
- docs: "Generating API reference" chapter added
- docs: minor formatting and spelling improvements to the "CONTRIBUTING.md"
- docs: "Unit symbols" chapter added
- docs: examples line numbers fixed
- docs: "Text Formatting" tag removed from avg_speed example
- docs: line breaks in mermaid graphs fixed
- docs: 2.3.0 release added
2.2.1 July 3, 2024¶
- (!) feat: Conan and CMake options refactored
2.2.0 June 14, 2024¶
- (!) feat: C++ modules support added by @JohelEGP
- (!) feat: New formatting specification implemented
- (!) feat:
has_unit_symbolsupport removed - (!) feat: ABI concerns resolved with introduction of u8 strings for symbols
- (!) feat: API-related Conan, CMake, and preprocessor options redesigned
- (!) feat:
core.hremoved - (!) feat: from now on units, dimensions, quantity specifications, and point origins
have to be marked as
final - feat: implicit point origins support added
- feat: unit default point origin support added
- feat:
fma,isfinite,isinf, andisnanmath function added by @NAThompson - feat:
fmafor quantity points added - feat:
quantity_pointsupport added forquantity_castandvalue_cast - feat:
value_cast<Unit, Representation>added - feat:
value_cast<Quantity>(q),value_cast<Quantity>(qp)andvalue_cast<QuantityPoint>(qp)added by @burnpanck - feat:
interconvertible(quantity_spec, quantity_spec)added - feat:
qp.quantity_from_zero()added - feat:
value_typetype trait added - feat: do not print space between a number and
percentorper_mille - feat:
ppmparts per million added by @nebkat - feat:
atan22-argument arctangent added by @nebkat - feat:
fmodfloating-point division remainder added by @nebkat - feat:
remainderIEEE division remainder added by @nebkat - feat:
std::formatsupport added - feat: unit text output support added
- feat: formatting error messages improved
- feat: improve types readability by eliminating extraneous
()in references, prefixes, andkind_of - feat: dimension and unit text output added
- feat: some light and radiation ISQ quantities added
- feat: allow configuring GSL library use
- feat: freestanding support added
- (!) refactor:
zero_Fahrenheitrenamed tozeroth_degree_Fahrenheit - (!) refactor: SI-related trigonometric functions moved to the
sisubnamespace - (!) refactor:
math.hheader file broke up to smaller pieces - (!) refactor:
fixed_stringinterface refactored - (!) refactor:
ReferenceOfdoes not take a dimension anymore - (!) refactor: 'o' replaced with '1' as a modifier for
unit_symbol_solidus::one_denominator - (!) refactor:
get_kind()now returnskind_of - (!) refactor: FMT macros moved to
compat_macros.h - (!) refactor:
fixed_stringrefactored to reflect the latest changes to P3094R2 - (!) refactor:
basic_symbol_textrenamed tosymbol_text - (!) refactor:
ratiohidden as an implementation detail behindmag_ratio - (!) refactor:
framework.hintroduced - (!) refactor: type list tools made an implementation detail of the library
- (!) refactor: header files with the entire system definitions moved up in the directory tree
- (!) refactor:
absolute_point_origindoes not use CRTP anymore - refactor: system's units do not inherit from one another anymore
- refactor: all units made
final - refactor: math functions constraints refactored
- refactor:
si_quantities.hadded to improve compile-times - refactor:
validate_ascii_stringrefactored tois_basic_literal_character_set - refactor:
underlying_typesplit towrapped_typeandvalue_typeand used in code - refactor: code refactored to comply with clang-tidy
- refactor: remove dependency on
<ranges>header and switch to use an iterator-basedcopyalgorithm - refactor:
terminatereplaced withabortand a header file added - refactor: most
std::remove_const_tremoved and some replaced with the GCC-specific workaround - refactor: not needed
remove_reference_tandremove_cvref_tremoved - refactor: binary operators of
quantityandquantity_pointare now hidden friends - fix:
QuantityLikeconversions requiredQ::repinstead of using one provided byquantity_like_traits - fix:
quantity_spec[Unit]replaced withmake_referenceinvalue_cast - fix:
ice_pointis now defined with the integral offset fromabsolute_zero - fix: performance regression in
sudo_castfixed - fix: explicit object parameter support fixed
- fix: missing
versionheader file added tohacks.h - fix:
quantity_castto accept lvalue references (thanks @burnpanck) - fix:
value_castwith lvalue references toquantity_point(thanks @burnpanck) - docs: project blog and first posts added
- docs: project documentation layout refactored
- docs: "Interoperability with Other Libraries" chapter added
- docs: "Framework Basics" chapters updated and cleaned up
- docs:
smootunit example added to the main page - docs: "Code Example" chapter renamed to "Look and Feel" and reordered in TOC to be after "Quick Start"
- docs: "Quick Start" chapter reworked to be simpler and include quantity points
- docs: "Quantity points" chapter extended
- docs: "The Affine Space" chapter updated to reflect the recent design changes
- docs: "Working with Legacy interfaces" chapter added
- docs: "Text Output" chapter updated
- docs: mkdocs social plugin enabled
- docs: project logo and custom color scheme added
- docs: minimum compiler requirements updated
- docs: unit symbols admonition extended in the "Quick Start" chapter
- docs: Cairo dependency described in the MkDocs section
- docs: "hello units" example updated with dimensions output
- docs: "Text Output" chapter updated with the recent formatting changes
- docs: formatting grammar language changed to EBNF
- docs: "Project structure" chapter expanded
- docs: CITATION.cff updated
- (!) build: Conan and CMake options refactored
- (!) build:
MP_UNITS_AS_SYSTEM_HEADERSrenamed toMP_UNITS_BUILD_AS_SYSTEM_HEADERS - (!) build:
MP_UNITS_BUILD_LAandMP_UNITS_IWYUCMake options now have_DEV_in the name - build: gsl-lite updated to 0.41.0
- build: catch2 updated to 3.5.1
- build: fmt updated to 10.2.1
- build: gitpod environment updated
- build:
check_cxx_feature_supportedadded - build: IWYU path handling fixed
- build: IWYU enabled on GCC
- build:
CMAKE_EXPORT_COMPILE_COMMANDSflag enabled for the developer's build - build(conan):
generate()now setcache_variables - build(conan):
can_runcheck added before running tests - ci: Conan and CMake CI now use different cache names
- ci: gcc-14 added
- ci:
clang-tidyCI added
2.1.1 May 16, 2024¶
- fix: unit tests compilation on gcc-14 fixed
- fix: explicit
thisparameter support fixed
2.1.0 December 9, 2023¶
- (!) feat:
inverse()support added for dimensions, quantity_spec, units, and references (1 / swill now createquantityand not aUnit) - (!) feat:
quantity_pointdoes not providezero()anymore - (!) feat:
quantity_specand its kind should not compare equal - (!) feat: mutating interface removed from
fixed_string - (!) feat:
common_typewith a raw value is not needed anymore as for a long time now raw values are not convertible to the dimensionless quantities - (!) feat:
symbol_textdefinition simplified - (!) feat: users are now allowed to inherit their own types from absolute point origins
- (!) feat: interoperability with other libraries redesigned
- feat:
basic_fixed_string(const CharT*, std::integral_constant<std::size_t, N>)constructor added - feat:
isq::activityadded andbecquereldefinition updated to benefit from it - feat:
grayandsievertnow have correct associated quantity kinds - feat:
UnitCompatibleWithconcept added and applied toin(U)andforce_in(U)functions - feat: quantities can now be multiplied and divided by units (no parenthesis needed anymore)
- feat:
Magnitude / Unitoperator added - feat: equality for dimensions now will allow derived classes as well (but not
from
derived_dimension) - feat:
zero_Fahrenheitpoint origin added - feat: equivalent point origins handling improved
- feat(example): unit symbols added to the currency example
- (!) refactor:
unit_symbol<fmt>(U)signature refactored and the resulting text can now also be used at runtime - (!) refactor:
make_xxxfactory functions replaced with two-parameter constructors - (!) refactor:
unit_symbolchanged toconsteval - refactor:
in(U)andforce_in(U)now returnautoto provide better diagnostics on clang - refactor:
quantityoperators constraints refactored - refactor: more type members added to
fixed_stringdefinition - refactor:
unit_symbol_formattingenums now usestd::int8_tas a representation type - fix: symbols of named dimensionless units with the ratio = 1 were not printed
- fix: iterator is now properly updated for all cases in
unit_symbol - fix: Fahrenheit conversion ratio was inverted
- fix:
CommonlyInvocableQuantitieswas overconstrained for the current library design - fix:
are_ingredients_convertiblenow mandates explicit conversion forTodimensionless quantities - fix:
quantity_point::point_for(PO)constraints fixed - fix(example):
latitudeandlongitudefixed to include0forNandErespectively - ci: clang-17 enabled
- ci: apple-clang-15 enabled
- ci: Added C++23 builds to the CI matrix
- docs: "Getting Started" chapters updated
- docs: "Basic Concepts" and "Interface Introduction" chapters updated
- docs: "Design Overview" chapter added and "Concepts" chapter reworked
- docs: "Output stream formatting" chapter updated
- docs: "Default formatting" chapter updated
- docs: "Derived unit symbols generation" chapter added
- docs: outdated affine space chapter updated
- docs:
CameCaseconcept identifiers FAQ added - docs:
gravitational_potential_energyequation fixed on a graph - docs: YouTube video link updated to the C++ on Sea 2023
- docs: ISO papers reference added to docs and README
- docs: a representation type in a dimensionless quantity FAQ fixed
- docs: titles added to some important admonitions
- docs: "Terms and Definitions" slightly updated
- docs: "canonical unit" added to glossary and its documentation in code was updated
- docs: Design overview graph updated
2.0.0 September 24, 2023¶
unitsnamespace renamed tomp_units(#317)- header files in the
<mp-units/...>rather then in<units/...>(#317) - the downcasting facility is removed (#383, #211, #32)
- unified and simplified quantity creation (#274)
- determining the best way to create a quantity (#413)
- V2
quantity_point(#414) - introduction of
quantity_specto store not onlydimensionbut also additional information about quantities (#405) quantitynow takesreferenceobject, which aggregatesquantity_specand aunitand arepresentationtype- units, prefixes, dimensions, quantity specifications, and references are passed as NTTPs to templates and provide arithmetic operations and comparison
- expression templates consistently used in all derived types to increase the readability (#351, #166)
- derived dimensions are now factors of only base dimensions (#281)
- convertibility of derived quantities (#427)
- dimensions, quantity specifications, units, and references are now composable, significantly reducing the number of definitions and resulting types
- heavily simplified unit systems definitions (no need to define unnamed derived units, systems-specific dimensions, aliases for quantities, concepts, UDLs, ... anymore)
- improved definition of all systems
- support for ISO 80000 Part 3-6 quantities
- faster than lightspeed constants (#169)
- extensions to quantity formatting with
fmt quantity_kindremoved- improved casting of unit with
.in(Unit),.force_in(Unit)forquantityandquantity_spec - numerical value accessor safety improved with
.numerical_value_in(Unit)and.force_numerical_value_in(Unit) quantitycan no longer be constructed with a raw value (#434)- Implicit construction of quantities from a value (#410)
quantity_pointcan no longer be constructed with just aquantityand an explicitPointOriginis always neededceilandfloorare dangerous (#432)- quecto, ronto, ronna, quetta new SI prefixes support
- comparison against zero added (#487)
- documentation rewritten from scratch
- many smaller changes not possible to address with the previous design (#205, #210, #134)
0.8.0 June 14, 2023¶
- (!) refactor:
common_quantity,common_quantity_for,common_quantity_point,common_quantity_kind, andcommon_quantity_point_kindremoved - (!) refactor:
named_derived_unitremoved as it was not used - (!) refactor:
derived_unitrenamed toderived_scaled_unit - (!) refactor:
unitrenamed toderived_unit - (!) refactor:
U::is_namedremoved from the unit types and replaced withNamedUnitconcept - (!) refactor:
PrefixFamilysupport removed - (!) refactor:
mi(naut)renamed tonmi - (!) refactor:
knotunit helper renamed toknin FPS - (!) refactor:
knottext symbol changed from"knot"to"kn" - refactor:
quantityop+()andop-()reimplemented in terms ofreferencerather thenquantitytypes - refactor(example):
glide_computernow use dimensionless quantities withranged_representationasrep - feat: HEP system support added (thanks @RalphSteinhagen)
- feat:
floor(),ceil(), andround()support added (thanks @hofbi) - feat:
std::formatsupport for compliant compilers added - feat: conversion helpers from
mp-unitstostd::chronotypes added - feat: math functions can now be safely used with user-defined types
- feat: conversion from
quantity_pointtostd::chrono::time_pointadded - feat:
nautical_mile_per_hourandknotadded tosi::internationalsystem - (!) fix: add
quantity_point::origin, likestd::chrono::time_point::clock - fix: enable any prefixes for most of the named units (beside those that use prefixes already)
- fix:
hectaredefinition fixed to be a prefixed version ofare+ other units - fix: account for different dimensions in
quantity_point_cast's constraint - fix: output stream operator now properly handles state
- fix:
fmtalgorithms were overconstrained withforward_iterator - fix: CTAD for aliases fixed
- fix:
derived_ratiocalculation - fix:
fill_tassignment operator fixed - fix: improve downcast mode off
- fix:
radioactivityheader compilation fixed - fix:
si::hep::dim_momentumduplicated definition fixed - fix:
fpscan now coexist withinternationalsystem - fix: public headers fixed to be standalone
- test: standalone public headers tests added
- (!) build: CMake generator in Conan is no longer obtained from an environment variable
- (!) build: Required Conan version bumped to 1.48
- (!) build: Conan 1.48 does not set
CMAKE_BUILD_TYPEin theconan_toolchain.cmakeanymore - build: AppleClang 13 support added (thanks @fdischner)
- build: most of the
conanfile.pyrefactored to be Conan 2.0 ready - build:
validate()replaced withconfigure()to raise errors duringconan installin Conan 1.X - build: minimum Conan version changed to 1.40
- build:
linear-algebraConan repo is no needed anymore - build: Gitpod support added
- build: clang-format-15 support added
- build: export config to local build (#322)
- build: fix export name of
mp-units-system - build: fmt updated to 8.0.1
- build: gsl-lite updated to 0.40.0
- build: catch2 updated to 2.13.9
- build: doxygen updated to 1.9.4
- build: linear_algebra/0.7.0 switched to wg21-linear_algebra/0.7.2
- ci: VS2022, gcc-11, clang-13, clang-14, and AppleClang 13 support added
- ci: pre-commit support added (thanks @hofbi)
- docs: Project documentation updated
- docs:
CITATION.cfffile added - docs:
CONTRIBUTING.mdupdated
0.7.0 May 11, 2021¶
- (!) refactor:
ScalableNumberrenamed toRepresentation - (!) refactor: output stream operators moved to the
units/quantity_io.hheader file - (!) refactor: Refactored the library file tree
- (!) refactor:
quantity::count()renamed toquantity::number() - (!) refactor:
datasystem renamed toisq::iec80000(quantity names renamed too) - (!) refactor:
*deduced_unitrenamed to*derived_unit - (!) refactor: got rid of a
noble_derived_unit - refactor: quantity (kind) point updated to reflect latest changes to
quantity - refactor: basic concepts,
quantityandquantity_castrefactored - refactor:
abs()definition refactored to be more explicit about the return type - feat: quantity (point) kind support added (thanks @johelegp)
- feat: quantity references support added (thanks @johelegp)
- feat: quantity aliases support added
- feat: interoperability with
std::chrono::durationand other units libraries - feat: CTAD for dimensionless quantity added
- feat:
modulation_ratesupport added (thanks @go2sh) - feat: SI prefixes for
isq::iec80000support added (thanks @go2sh) - feat: a possibility to disable quantity UDLs support with
UNITS_NO_LITERALSpreprocessor define - feat: a support to define ISQ derived dimensions in terms of different number or order of components
- perf: preconditions check do not influence the runtime performance of a Release build
- perf:
quantity_cast()generates less assembly instructions - perf: temporary string creation removed from
quantity::op<<() - perf: value initialization for quantity value removed (left with a default initialization)
- perf: limited the
equivalenttrait usage - perf: limited the C++ Standard Library headers usage
- perf: rvalue references support added for constructors and getters
- (!) fix:
exp()has sense only for dimensionless quantities - (!) fix:
dim_torquenow properly divides by an angle (instead of multiply) + default unit name change - fix: quantity's operators fixed to behave like the underlying types do
- fix:
quantity_cast()fixed to work correctly with representation types not convertible fromstd::intmax_t - fix: ambiguous case for empty type list resolved
- fix: downcasting facility for non-default-constructible types
- fix: restore user-warnings within the library implementation
- fix: the text symbol of
foot_pound_forceandfoot_pound_force_per_second - fix: quantity modulo arithmetics fixed
- (!) build: Conan testing version is now hosted on Artifactory
- (!) build: Linear Algebra is now hosted on its Artifactory
- (!) build:
BUILD_DOCSCMake option renamed toUNITS_BUILD_DOCS - build: doxygen updated to 1.8.20
- build: catch2 updated to 2.13.4
- build: fmt updated to 7.1.3
- build: ms-gsl replaced with gsl-lite/0.38.0
- build: Conan generator switched to
cmake_find_package_multi - build: Conan CMakeToolchain support added
- build: CMake scripts cleanup
- build: ccache support added
- ci: CI switched from Travis CI to GitHub Actions
0.6.0 September 13, 2020¶
- feat:
quantity_pointsupport added (thanks @johelegp) - feat: Added angle as SI base dimension (thanks @kwikius)
- feat:
si::angular_velocitysupport added (thanks @mikeford3) - feat: FPS system added (thanks @mikeford3)
- feat: Added support for mathematical function
exp(quantity) - feat: Localization support for text output added (thanks @rbrugo)
- feat: Added STL random number distribution wrappers (thanks @yasamoka)
- (!) refactor: Refactored and cleaned up the library file tree
- (!) refactor:
q_*UDL renamed to_q_* - (!) refactor: UDLs with "per" in name renamed from
*p*to*_per_* - (!) refactor:
ratiochanged to the NTTP kind - (!) refactor:
expandExprenamed toexponentandExponent - (!) refactor:
Scalarconcept renamed toScalableNumber - (!) refactor: Dimensionless quantities redesigned to be of a
quantitytype - refactor:
math.hfunction signatures refactored to use aQuantityconcept (thanks @kwikius) - refactor:
[[nodiscard]]added to many functions - fix:
si::dayunit symbol fixed tod(thanks @komputerwiz) - fix:
si::moleunit symbol fixed tomol(thanks @mikeford3) - (!) build: gcc-9 is no longer supported (at least gcc-10 is required)
- build: Visual Studio 16.7 support added
- build: linear_algebra updated to 0.7.0/stable
- build: fmt updated to 7.0.3
- build: range-v3 updated to 0.11.0
- build: catch2 updated to 2.13.0
- build: doxygen updated to 1.8.18
- build: ms-gsl 3.1.0 dependency added
- build: Removed the dependency on a git submodule with common CMake scripts
0.5.0 May 17, 2020¶
- Major refactoring and rewrite of the library
- Units are now independent from dimensions
- Dimensions now depend on units (base or coherent units are provided in a class template)
- Quantity gets a Dimension template parameter again (as unit does not provide information about its dimension anymore)
- Spaceship operator support added
- Added official CGS system support
- Added official data information system support
- Repository file tree cleanup
ratiorefactored to containExptemplate parameter (thanks a lot @oschonrock!)- SI fundamental constants added
q_prefix applied to all the UDLs (thanks @kwikius)unknown_unitrenamed tounknown_coherent_unit- Project documentation greatly extended and switched to Sphinx
- A few more usage examples added
- ASCII-only output support added (thanks @yasamoka)
- Representation values formatting extended (thanks @rbrugo)
- Output streams formatting support added
- Linear algebra from
std::experimental::mathsupport added - Named SI units and their dimensions added (thanks @rbrugo
- libfmt updated to 6.2.0
- Added absolute functions and epsilon to math.h (thanks @mikeford3)
- Added a lot of prefixes to named units and introduced
alias_unit(thanks @yasamoka) - Linking with Conan targets only when they exists (#98)
- All physical dimensions and units put into
physicalnamespace - CMake improvements
- Velocity renamed to speed
Many thanks to GitHub users @oschonrock, @kwikius, and @i-ky for their support in drafting a new library design.
0.4.0 Nov 17, 2019¶
- Support for derived dimensions in
expadded - Added
pow()andsqrt()operations on quantities unitsremoved from astd::experimentalnamespace- Downcasting facility refactored so the user does not have to write the boilerplate code anymore
- From now on base dimensions should inherit from
base_dimensionclass template - Added unit symbols definitions to
base_dimensionand derived units - Added support for
operator<<onquantity fmtsupport added- Derived unit factory helpers refactored
- Refactored the way prefixed units are defined
0.3.1 Sep 18, 2019¶
- cmcstl2 dependency changed to range-v3 0.9.1
0.3.0 Sep 16, 2019¶
- The design as described on CppCon 2019 talk (https://youtu.be/0YW6yxkdhlU)
- Applied the feedback from the Cologne evening session
upcasting_traitsrenamed todowncasting_traitsDimensiontemplate parameter removed from quantity
unitsmoved to astd::experimentalnamespace- Leading underscore prefix removed from UDLs
- Added a few more derived dimensions
meterrenamed tometre- Missing
operator*added - Predefined dimensions moved to a dedicated directory
dimension_prefix removed from names of derived dimensions- cmcstl2 library updated to 2019.09.19
base_dimensionis a value provided asconst&to theexptype- integrated with Compiler Explorer
- gsl-lite dependency removed
- Fractional dimension exponents support added
QuantityOfconcept introducedquantity_cast<U, Rep>()support added
0.2.0 July 18, 2019¶
- The design as described on C++Now 2019 talk (https://youtu.be/wKchCktZPHU)
- Added C++20 features supported by gcc-9.1 (
std::remove_cvref_t, down with typename,std::type_identity) - Compile-time performance optimizations (
type_list,common_ratio,ratio,conditional_t)
0.1.0 May 18, 2019¶
- Initial library release
- Begin semantic versioning
- The last version to work with gcc-8