24 constexpr UnitSystem<double> si{};
33 constexpr UnitSystem<double> astro{
43 std::cout << astro.
get<constants::G>() << std::endl;
58 std::cout << Constants<double>{astro}.get<constants::G>() << std::endl;
Physical constants in a unit system, plus a few dimensionless numbers.
A unit system: the values of the seven SI base units in code units.
constexpr Tret to() const noexcept
constexpr Tret get() const noexcept
Value of the compile-time unit u in this system.
The table of physical constants: each constant is a Unit (its SI value and dimension).
constexpr Unit sol_mass
solar mass
namespace containing the units library
constexpr Unit< T > upow(Unit< T > u, int n) noexcept
Integer power of a unit.
The table of unit prefixes: a prefix is a dimensionless Unit.
The table of units: one constexpr Unit per unit, plus its name registry.
Unit from_name(std::string_view name)
Unit from its long or short name; throws std::invalid_argument if unknown.
constexpr Unit year
yr (Julian)
constexpr Unit astronomical_unit
au