refactor: Fine-grained references support added

This commit is contained in:
Mateusz Pusz
2021-04-07 11:26:45 +02:00
parent afa67c5f43
commit bd862d3517
59 changed files with 400 additions and 68 deletions

View File

@@ -58,12 +58,18 @@ They are defined using the `reference` class template::
#ifdef UNITS_REFERENCES
namespace references {
namespace length_references {
inline constexpr auto km = reference<dim_length, kilometre>{};
inline constexpr auto h = reference<dim_time, hour>{};
}
} // namespace length_references
namespace references {
using namespace length_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -39,12 +39,12 @@
namespace {
using namespace units::isq;
using namespace si::references;
using namespace si::mass_references;
using namespace si::volume_references;
inline constexpr Acceleration auto g = si::si2019::standard_gravity<>;
inline constexpr Density auto air_density = 1.225 * (kg / m3);
class Box {
si::area<si::square_metre> base_;
si::length<si::metre> height_;
@@ -82,6 +82,8 @@ public:
int main()
{
using namespace units;
using namespace si::length_references;
using namespace si::time_references;
const si::length<si::metre> height = 200.0 * mm;
auto box = Box(1000.0 * mm, 500.0 * mm, height);

View File

@@ -24,21 +24,21 @@
UNITS_DIAGNOSTIC_PUSH
UNITS_DIAGNOSTIC_IGNORE_SHADOW
#include <units/isq/si/force.h>
UNITS_DIAGNOSTIC_POP
#include <units/generic/angle.h>
#include <units/isq/si/energy.h>
#include <units/isq/si/force.h>
#include <units/isq/si/length.h>
#include <units/isq/si/torque.h> // IWYU pragma: keep
#include <units/quantity_io.h>
UNITS_DIAGNOSTIC_POP
#include <iostream>
int main()
{
using namespace units::references;
using namespace units::isq;
using namespace units::isq::si::references;
using namespace units::references;
Torque auto torque = 20.0 * (N * m / rad);
Energy auto energy = 20.0 * J;

View File

@@ -60,7 +60,8 @@ std::ostream& operator<<(std::ostream& os, const matrix<ET, OT>& v)
namespace {
using namespace units::isq;
using namespace units::isq::si::references;
using namespace units::isq::si::length_references;
using namespace units::isq::si::force_references;
template<typename Rep = double>
using vector = std::math::fs_vector<Rep, 3>;
@@ -68,7 +69,6 @@ using vector = std::math::fs_vector<Rep, 3>;
template<typename Rep = double>
using matrix = std::math::fs_matrix<Rep, 3, 3>;
void vector_of_quantity_add()
{
std::cout << "\nvector_of_quantity_add:\n";

View File

@@ -21,11 +21,11 @@
// SOFTWARE.
#include <units/isq/natural/natural.h>
#include <units/isq/si/constants.h>
#include <units/isq/si/energy.h>
#include <units/isq/si/mass.h>
#include <units/isq/si/momentum.h>
#include <units/isq/si/speed.h> // IWYU pragma: keep
#include <units/isq/si/constants.h>
#include <units/math.h>
#include <units/quantity_io.h>
#include <exception>
@@ -43,7 +43,7 @@ Energy auto total_energy(Momentum auto p, Mass auto m, Speed auto c)
void si_example()
{
using namespace units::isq::si;
using namespace units::isq::si::references;
using namespace units::isq::si::energy_references;
constexpr Speed auto c = si2019::speed_of_light<>;

View File

@@ -57,10 +57,16 @@ constexpr auto operator"" _q_rad(long double l) { return angle<radian, long doub
#ifdef UNITS_REFERENCES
namespace references {
namespace angle_references {
inline constexpr auto rad = reference<dim_angle<>, radian>{};
} // namespace angle_references
namespace references {
using namespace angle_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -61,12 +61,18 @@ using reference_divide = detail::reference_divide_impl<
* This type is intended to be used in the quantity references definition:
*
* @code{.cpp}
* namespace references {
* namespace length_references {
*
* inline constexpr auto m = reference<dim_length, metre>{};
* inline constexpr auto km = reference<dim_length, kilometre>{};
*
* }
*
* namespace references {
*
* using namespace length_references;
*
* }
* @endcode
*
* Quantity references simplify quantity creation:

View File

@@ -70,7 +70,7 @@ constexpr auto operator"" _q_YBd(unsigned long long l) { gsl_ExpectsAudit(std::i
#ifdef UNITS_REFERENCES
namespace references {
namespace modulation_rate_references {
inline constexpr auto Bd = reference<dim_modulation_rate, baud>{};
inline constexpr auto kBd = reference<dim_modulation_rate, kilobaud>{};
@@ -82,6 +82,12 @@ inline constexpr auto EBd = reference<dim_modulation_rate, exabaud>{};
inline constexpr auto ZBd = reference<dim_modulation_rate, zettabaud>{};
inline constexpr auto YBd = reference<dim_modulation_rate, yottabaud>{};
} // namespace modulation_rate_references
namespace references {
using namespace modulation_rate_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -127,7 +127,7 @@ constexpr auto operator"" _q_PiB(unsigned long long l) { gsl_ExpectsAudit(std::i
#ifdef UNITS_REFERENCES
namespace references {
namespace storage_capacity_references {
// bits
inline constexpr auto bit = reference<dim_storage_capacity, iec80000::bit>{};
@@ -167,6 +167,12 @@ inline constexpr auto TiB = reference<dim_storage_capacity, tebibyte>{};
inline constexpr auto PiB = reference<dim_storage_capacity, pebibyte>{};
// inline constexpr auto EiB = reference<dim_storage_capacity, exbibyte>{};
} // namespace storage_capacity_references
namespace references {
using namespace storage_capacity_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -55,10 +55,16 @@ constexpr auto operator"" _q_E(unsigned long long l) { gsl_ExpectsAudit(std::in_
#ifdef UNITS_REFERENCES
namespace references {
namespace traffic_intensity_references {
inline constexpr auto E = reference<dim_traffic_intensity, erlang>{};
} // namespace traffic_intensity_references
namespace references {
using namespace traffic_intensity_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -54,10 +54,16 @@ constexpr auto operator"" _q_Gal(long double l) { return acceleration<gal, long
#ifdef UNITS_REFERENCES
namespace references {
namespace acceleration_references {
inline constexpr auto Gal = reference<dim_acceleration, gal>{};
} // namespace acceleration_references
namespace references {
using namespace acceleration_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -56,10 +56,16 @@ constexpr auto operator"" _q_cm2(long double l) { return area<square_centimetre,
#ifdef UNITS_REFERENCES
namespace references {
namespace area_references {
inline constexpr auto cm2 = reference<dim_area, square_centimetre>{};
} // namespace area_references
namespace references {
using namespace area_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -56,10 +56,16 @@ constexpr auto operator"" _q_erg(long double l) { return energy<erg, long double
#ifdef UNITS_REFERENCES
namespace references {
namespace energy_references {
inline constexpr auto erg = reference<dim_energy, cgs::erg>{};
} // namespace energy_references
namespace references {
using namespace energy_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -57,10 +57,16 @@ constexpr auto operator"" _q_dyn(long double l) { return force<dyne, long double
#ifdef UNITS_REFERENCES
namespace references {
namespace force_references {
inline constexpr auto dyn = reference<dim_force, dyne>{};
} // namespace force_references
namespace references {
using namespace force_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -55,10 +55,16 @@ constexpr auto operator"" _q_cm(long double l) { return length<centimetre, long
#ifdef UNITS_REFERENCES
namespace references {
namespace length_references {
inline constexpr auto cm = reference<dim_length, centimetre>{};
} // namespace length_references
namespace references {
using namespace length_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -55,10 +55,16 @@ constexpr auto operator"" _q_g(long double l) { return mass<gram, long double>(l
#ifdef UNITS_REFERENCES
namespace references {
namespace mass_references {
inline constexpr auto g = reference<dim_mass, gram>{};
} // namespace mass_references
namespace references {
using namespace mass_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -57,10 +57,16 @@ constexpr auto operator"" _q_Ba(long double l) { return pressure<barye, long dou
#ifdef UNITS_REFERENCES
namespace references {
namespace pressure_references {
inline constexpr auto Ba = reference<dim_pressure, barye>{};
} // namespace pressure_references
namespace references {
using namespace pressure_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -49,10 +49,16 @@ using si::literals::operator"" _q_s;
#ifdef UNITS_REFERENCES
namespace references {
namespace time_references {
using si::references::s;
} // namespace time_references
namespace references {
using namespace time_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -55,10 +55,16 @@ constexpr auto operator"" _q_ft2(long double l) { return area<square_foot, long
#ifdef UNITS_REFERENCES
namespace references {
namespace area_references {
inline constexpr auto ft2 = reference<dim_area, square_foot>{};
} // namespace area_references
namespace references {
using namespace area_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -74,12 +74,18 @@ constexpr auto operator"" _q_klbf(long double l) { return force<kilopound_force,
#ifdef UNITS_REFERENCES
namespace references {
namespace force_references {
inline constexpr auto pdl = reference<dim_force, poundal>{};
inline constexpr auto lbf = reference<dim_force, pound_force>{};
inline constexpr auto klbf = reference<dim_force, kilopound_force>{};
} // namespace force_references
namespace references {
using namespace force_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -104,7 +104,7 @@ constexpr auto operator"" _q_naut_mi(long double l) { return length<nautical_mil
#ifdef UNITS_REFERENCES
namespace references {
namespace length_references {
inline constexpr auto thou = reference<dim_length, thousandth>{};
inline constexpr auto mil = thou;
@@ -117,6 +117,12 @@ inline constexpr auto kyd = reference<dim_length, kiloyard>{};
inline constexpr auto mile = reference<dim_length, fps::mile>{};
inline constexpr auto naut_mi = reference<dim_length, nautical_mile>{};
} // namespace length_references
namespace references {
using namespace length_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -104,7 +104,7 @@ constexpr auto operator"" _q_lton(long double l) { return mass<long_ton, long do
#ifdef UNITS_REFERENCES
namespace references {
namespace mass_references {
inline constexpr auto gr = reference<dim_mass, grain>{};
inline constexpr auto dr = reference<dim_mass, dram>{};
@@ -116,6 +116,12 @@ inline constexpr auto cwt = reference<dim_mass, hundredweight>{};
inline constexpr auto ston = reference<dim_mass, short_ton>{};
inline constexpr auto lton = reference<dim_mass, long_ton>{};
} // namespace mass_references
namespace references {
using namespace mass_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -68,10 +68,16 @@ constexpr auto operator"" _q_hp(long double l) { return power<horse_power, long
#ifdef UNITS_REFERENCES
namespace references {
namespace power_references {
inline constexpr auto hp = reference<dim_power, horse_power>{};
} // namespace power_references
namespace references {
using namespace power_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -71,11 +71,17 @@ constexpr auto operator"" _q_kpsi(long double l) { return pressure<kilopound_for
#ifdef UNITS_REFERENCES
namespace references {
namespace pressure_references {
inline constexpr auto psi = reference<dim_pressure, pound_force_per_inch_sq>{};
inline constexpr auto kpsi = reference<dim_pressure, kilopound_force_per_inch_sq>{};
} // namespace pressure_references
namespace references {
using namespace pressure_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -70,11 +70,17 @@ constexpr auto operator"" _q_knot(long double l) { return speed<knot, long doubl
#ifdef UNITS_REFERENCES
namespace references {
namespace speed_references {
inline constexpr auto mph = reference<dim_speed, mile_per_hour>{};
inline constexpr auto knot = reference<dim_speed, fps::knot>{};
} // namespace speed_references
namespace references {
using namespace speed_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -53,10 +53,16 @@ using si::literals::operator"" _q_s;
#ifdef UNITS_REFERENCES
namespace references {
namespace time_references {
using si::references::s;
} // namespace time_references
namespace references {
using namespace time_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -60,11 +60,17 @@ constexpr auto operator"" _q_yd3(long double l) { return volume<cubic_yard, long
#ifdef UNITS_REFERENCES
namespace references {
namespace volume_references {
inline constexpr auto ft3 = reference<dim_volume, cubic_foot>{};
inline constexpr auto yd3 = reference<dim_volume, cubic_yard>{};
} // namespace volume_references
namespace references {
using namespace volume_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -66,12 +66,18 @@ constexpr auto operator"" _q_angstrom(long double l) { return si::length<angstro
#ifdef UNITS_REFERENCES
namespace references {
namespace length_references {
inline constexpr auto ly = reference<si::dim_length, light_year>{};
inline constexpr auto pc = reference<si::dim_length, parsec>{};
inline constexpr auto angstrom = reference<si::dim_length, iau::angstrom>{};
} // namespace length_references
namespace references {
using namespace length_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -58,11 +58,17 @@ constexpr auto operator"" _q_rd(long double l) { return si::length<rod, long dou
#ifdef UNITS_REFERENCES
namespace references {
namespace length_references {
inline constexpr auto ch = reference<si::dim_length, chain>{};
inline constexpr auto rd = reference<si::dim_length, rod>{};
} // namespace length_references
namespace references {
using namespace length_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -51,10 +51,16 @@ constexpr auto operator"" _q_ft2(long double l) { return si::area<square_foot, l
#ifdef UNITS_REFERENCES
namespace references {
namespace area_references {
inline constexpr auto ft2 = reference<si::dim_area, square_foot>{};
} // namespace area_references
namespace references {
using namespace area_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -108,7 +108,7 @@ constexpr auto operator"" _q_mil(long double l) { return si::length<mil, long do
#ifdef UNITS_REFERENCES
namespace references {
namespace length_references {
inline constexpr auto yd = reference<si::dim_length, yard>{};
inline constexpr auto ft = reference<si::dim_length, foot>{};
@@ -119,6 +119,12 @@ inline constexpr auto mi_naut = reference<si::dim_length, nautical_mile>{};
inline constexpr auto thou = reference<si::dim_length, international::thou>{};
inline constexpr auto mil = reference<si::dim_length, international::mil>{};
} // namespace length_references
namespace references {
using namespace length_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -51,10 +51,16 @@ constexpr auto operator"" _q_ft3(long double l) { return si::volume<cubic_foot,
#ifdef UNITS_REFERENCES
namespace references {
namespace volume_references {
inline constexpr auto ft3 = reference<si::dim_volume, cubic_foot>{};
} // namespace volume_references
namespace references {
using namespace volume_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -67,13 +67,19 @@ constexpr auto operator"" _q_point_prn(long double l) { return si::length<point_
#ifdef UNITS_REFERENCES
namespace references {
namespace length_references {
inline constexpr auto pica_comp = reference<si::dim_length, typographic::pica_comp>{};
inline constexpr auto pica_prn = reference<si::dim_length, typographic::pica_prn>{};
inline constexpr auto point_comp = reference<si::dim_length, typographic::point_comp>{};
inline constexpr auto point_prn = reference<si::dim_length, typographic::point_prn>{};
} // namespace length_references
namespace references {
using namespace length_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -67,12 +67,18 @@ constexpr auto operator"" _q_mi_us(long double l) { return si::length<units::isq
#ifdef UNITS_REFERENCES
namespace references {
namespace length_references {
inline constexpr auto ft = reference<si::dim_length, us::foot>{};
inline constexpr auto fathom = reference<si::dim_length, us::fathom>{};
inline constexpr auto mi = reference<si::dim_length, us::mile>{};
} // namespace length_references
namespace references {
using namespace length_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -156,7 +156,7 @@ constexpr auto operator"" _q_YGy(long double l) { return absorbed_dose<yottagray
#ifdef UNITS_REFERENCES
namespace references {
namespace absorbed_dose_references {
inline constexpr auto Gy = reference<dim_absorbed_dose, gray>{};
inline constexpr auto yGy = reference<dim_absorbed_dose, yoctogray>{};
@@ -180,6 +180,12 @@ inline constexpr auto EGy = reference<dim_absorbed_dose, exagray>{};
inline constexpr auto ZGy = reference<dim_absorbed_dose, zettagray>{};
inline constexpr auto YGy = reference<dim_absorbed_dose, yottagray>{};
} // namespace absorbed_dose_references
namespace references {
using namespace absorbed_dose_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -55,10 +55,16 @@ constexpr auto operator"" _q_mol(long double l) { return amount_of_substance<mol
#ifdef UNITS_REFERENCES
namespace references {
namespace amount_of_substance_references {
inline constexpr auto mol = reference<dim_amount_of_substance, mole>{};
} // namespace amount_of_substance_references
namespace references {
using namespace amount_of_substance_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -161,7 +161,7 @@ constexpr auto operator"" _q_ha(long double l) { return area<hectare, long doubl
#ifdef UNITS_REFERENCES
namespace references {
namespace area_references {
inline constexpr auto m2 = reference<dim_area, square_metre>{};
inline constexpr auto ym2 = reference<dim_area, square_yoctometre>{};
@@ -186,6 +186,12 @@ inline constexpr auto Zm2 = reference<dim_area, square_zettametre>{};
inline constexpr auto Ym2 = reference<dim_area, square_yottametre>{};
inline constexpr auto ha = reference<dim_area, hectare>{};
} // namespace area_references
namespace references {
using namespace area_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -157,7 +157,7 @@ constexpr auto operator"" _q_YF(long double l) { return capacitance<yottafarad,
#ifdef UNITS_REFERENCES
namespace references {
namespace capacitance_references {
inline constexpr auto F = reference<dim_capacitance, farad>{};
inline constexpr auto yF = reference<dim_capacitance, yoctofarad>{};
@@ -181,6 +181,12 @@ inline constexpr auto EF = reference<dim_capacitance, exafarad>{};
inline constexpr auto ZF = reference<dim_capacitance, zettafarad>{};
inline constexpr auto YF = reference<dim_capacitance, yottafarad>{};
} // namespace capacitance_references
namespace references {
using namespace capacitance_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -163,7 +163,7 @@ constexpr auto operator"" _q_U(long double l) { return catalytic_activity<enzyme
#ifdef UNITS_REFERENCES
namespace references {
namespace catalytic_activity_references {
inline constexpr auto kat = reference<dim_catalytic_activity, katal>{};
inline constexpr auto ykat = reference<dim_catalytic_activity, yoctokatal>{};
@@ -188,9 +188,14 @@ inline constexpr auto Zkat = reference<dim_catalytic_activity, zettakatal>{};
inline constexpr auto Ykat = reference<dim_catalytic_activity, yottakatal>{};
inline constexpr auto U = reference<dim_catalytic_activity, enzyme_unit>{};
}
namespace references {
using namespace catalytic_activity_references;
} // namespace references
#endif // UNITS_REFERENCES
} // namespace units::isq::si

View File

@@ -136,7 +136,7 @@ constexpr auto operator"" _q_YS(long double l) { return conductance<yottasiemens
#ifdef UNITS_REFERENCES
namespace references {
namespace conductance_references {
inline constexpr auto S = reference<dim_conductance, siemens>{};
inline constexpr auto yS = reference<dim_conductance, yoctosiemens>{};
@@ -156,6 +156,12 @@ inline constexpr auto ES = reference<dim_conductance, exasiemens>{};
inline constexpr auto ZS = reference<dim_conductance, zettasiemens>{};
inline constexpr auto YS = reference<dim_conductance, yottasiemens>{};
} // namespace conductance_references
namespace references {
using namespace conductance_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -56,10 +56,16 @@ constexpr auto operator"" _q_C(long double l) { return electric_charge<coulomb,
#ifdef UNITS_REFERENCES
namespace references {
namespace electric_charge_references {
inline constexpr auto C = reference<dim_electric_charge, coulomb>{};
} // namespace electric_charge_references
namespace references {
using namespace electric_charge_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -155,7 +155,7 @@ constexpr auto operator"" _q_YA(long double l) { return electric_current<yottaam
#ifdef UNITS_REFERENCES
namespace references {
namespace electric_current_references {
inline constexpr auto A = reference<dim_electric_current, ampere>{};
inline constexpr auto yA = reference<dim_electric_current, yoctoampere>{};
@@ -179,6 +179,12 @@ inline constexpr auto EA = reference<dim_electric_current, exaampere>{};
inline constexpr auto ZA = reference<dim_electric_current, zettaampere>{};
inline constexpr auto YA = reference<dim_electric_current, yottaampere>{};
} // namespace electric_current_references
namespace references {
using namespace electric_current_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -147,7 +147,7 @@ constexpr auto operator"" _q_GeV(long double l) { return energy<gigaelectronvolt
#ifdef UNITS_REFERENCES
namespace references {
namespace energy_references {
inline constexpr auto J = reference<dim_energy, joule>{};
inline constexpr auto yJ = reference<dim_energy, yoctojoule>{};
@@ -166,9 +166,16 @@ inline constexpr auto PJ = reference<dim_energy, petajoule>{};
inline constexpr auto EJ = reference<dim_energy, exajoule>{};
inline constexpr auto ZJ = reference<dim_energy, zettajoule>{};
inline constexpr auto YJ = reference<dim_energy, yottajoule>{};
inline constexpr auto eV = reference<dim_energy, electronvolt>{};
inline constexpr auto GeV = reference<dim_energy, gigaelectronvolt>{};
} // namespace energy_references
namespace references {
using namespace energy_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -157,7 +157,7 @@ constexpr auto operator"" _q_YN(long double l) { return force<yottanewton, long
#ifdef UNITS_REFERENCES
namespace references {
namespace force_references {
inline constexpr auto N = reference<dim_force, newton>{};
inline constexpr auto yN = reference<dim_force, yoctonewton>{};
@@ -181,6 +181,12 @@ inline constexpr auto EN = reference<dim_force, exanewton>{};
inline constexpr auto ZN = reference<dim_force, zettanewton>{};
inline constexpr auto YN = reference<dim_force, yottanewton>{};
} // namespace force_references
namespace references {
using namespace force_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -135,7 +135,7 @@ constexpr auto operator"" _q_YHz(long double l) { return frequency<yottahertz, l
#ifdef UNITS_REFERENCES
namespace references {
namespace frequency_references {
inline constexpr auto Hz = reference<dim_frequency, hertz>{};
inline constexpr auto yHz = reference<dim_frequency, yoctohertz>{};
@@ -155,6 +155,12 @@ inline constexpr auto EHz = reference<dim_frequency, exahertz>{};
inline constexpr auto ZHz = reference<dim_frequency, zettahertz>{};
inline constexpr auto YHz = reference<dim_frequency, yottahertz>{};
} // namespace frequency_references
namespace references {
using namespace frequency_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -137,7 +137,7 @@ constexpr auto operator"" _q_YH(long double l) { return inductance<yottahenry, l
#ifdef UNITS_REFERENCES
namespace references {
namespace inductance_references {
inline constexpr auto H = reference<dim_inductance, henry>{};
inline constexpr auto yH = reference<dim_inductance, yoctohenry>{};
@@ -157,6 +157,12 @@ inline constexpr auto EH = reference<dim_inductance, exahenry>{};
inline constexpr auto ZH = reference<dim_inductance, zettahenry>{};
inline constexpr auto YH = reference<dim_inductance, yottahenry>{};
} // namespace inductance_references
namespace references {
using namespace inductance_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -161,7 +161,7 @@ constexpr auto operator"" _q_au(long double l) { return length<astronomical_unit
#ifdef UNITS_REFERENCES
namespace references {
namespace length_references {
inline constexpr auto m = reference<dim_length, metre>{};
inline constexpr auto ym = reference<dim_length, yoctometre>{};
@@ -186,6 +186,12 @@ inline constexpr auto Zm = reference<dim_length, zettametre>{};
inline constexpr auto Ym = reference<dim_length, yottametre>{};
inline constexpr auto au = reference<dim_length, astronomical_unit>{};
} // namespace length_references
namespace references {
using namespace length_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -155,7 +155,7 @@ constexpr auto operator"" _q_Ycd(long double l) { return luminous_intensity<yott
#ifdef UNITS_REFERENCES
namespace references {
namespace luminous_intensity_references {
inline constexpr auto cd = reference<dim_luminous_intensity, candela>{};
inline constexpr auto ycd = reference<dim_luminous_intensity, yoctocandela>{};
@@ -179,6 +179,12 @@ inline constexpr auto Ecd = reference<dim_luminous_intensity, exacandela>{};
inline constexpr auto Zcd = reference<dim_luminous_intensity, zettacandela>{};
inline constexpr auto Ycd = reference<dim_luminous_intensity, yottacandela>{};
} // namespace luminous_intensity_references
namespace references {
using namespace luminous_intensity_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -137,7 +137,7 @@ constexpr auto operator"" _q_YWb(long double l) { return magnetic_flux<yottawebe
#ifdef UNITS_REFERENCES
namespace references {
namespace magnetic_flux_references {
inline constexpr auto Wb = reference<dim_magnetic_flux, weber>{};
inline constexpr auto yWb = reference<dim_magnetic_flux, yoctoweber>{};
@@ -157,6 +157,12 @@ inline constexpr auto EWb = reference<dim_magnetic_flux, exaweber>{};
inline constexpr auto ZWb = reference<dim_magnetic_flux, zettaweber>{};
inline constexpr auto YWb = reference<dim_magnetic_flux, yottaweber>{};
} // namespace magnetic_flux_references
namespace references {
using namespace magnetic_flux_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -145,7 +145,7 @@ constexpr auto operator"" _q_G(long double l) { return magnetic_induction<gauss,
#ifdef UNITS_REFERENCES
namespace references {
namespace magnetic_induction_references {
inline constexpr auto T = reference<dim_magnetic_induction, tesla>{};
inline constexpr auto yT = reference<dim_magnetic_induction, yoctotesla>{};
@@ -166,6 +166,12 @@ inline constexpr auto ZT = reference<dim_magnetic_induction, zettatesla>{};
inline constexpr auto YT = reference<dim_magnetic_induction, yottatesla>{};
inline constexpr auto G = reference<dim_magnetic_induction, gauss>{};
} // namespace magnetic_induction_references
namespace references {
using namespace magnetic_induction_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -268,7 +268,7 @@ constexpr auto operator"" _q_Da(long double l) { return mass<dalton, long double
#ifdef UNITS_REFERENCES
namespace references {
namespace mass_references {
inline constexpr auto g = reference<dim_mass, gram>{};
inline constexpr auto yg = reference<dim_mass, yoctogram>{};
@@ -314,6 +314,12 @@ inline constexpr auto Zt = reference<dim_mass, zettatonne>{};
inline constexpr auto Yt = reference<dim_mass, yottatonne>{};
inline constexpr auto Da = reference<dim_mass, dalton>{};
} // namespace mass_references
namespace references {
using namespace mass_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -136,7 +136,7 @@ constexpr auto operator"" _q_YW(long double l) { return power<yottawatt, long do
#ifdef UNITS_REFERENCES
namespace references {
namespace power_references {
inline constexpr auto W = reference<dim_power, watt>{};
inline constexpr auto yW = reference<dim_power, yoctowatt>{};
@@ -156,6 +156,12 @@ inline constexpr auto EW = reference<dim_power, exawatt>{};
inline constexpr auto ZW = reference<dim_power, zettawatt>{};
inline constexpr auto YW = reference<dim_power, yottawatt>{};
} // namespace power_references
namespace references {
using namespace power_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -157,7 +157,7 @@ constexpr auto operator"" _q_YPa(long double l) { return pressure<yottapascal, l
#ifdef UNITS_REFERENCES
namespace references {
namespace pressure_references {
inline constexpr auto Pa = reference<dim_pressure, pascal>{};
inline constexpr auto yPa = reference<dim_pressure, yoctopascal>{};
@@ -181,6 +181,12 @@ inline constexpr auto EPa = reference<dim_pressure, exapascal>{};
inline constexpr auto ZPa = reference<dim_pressure, zettapascal>{};
inline constexpr auto YPa = reference<dim_pressure, yottapascal>{};
} // namespace pressure_references
namespace references {
using namespace pressure_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -155,7 +155,7 @@ constexpr auto operator"" _q_YBq(long double l) { return radioactivity<yottabecq
#ifdef UNITS_REFERENCES
namespace references {
namespace radioactivity_references {
inline constexpr auto Bq = reference<dim_radioactivity, becquerel>{};
inline constexpr auto yBq = reference<dim_radioactivity, yoctobecquerel>{};
@@ -179,6 +179,12 @@ inline constexpr auto EBq = reference<dim_radioactivity, exabecquerel>{};
inline constexpr auto ZBq = reference<dim_radioactivity, zettabecquerel>{};
inline constexpr auto YBq = reference<dim_radioactivity, yottabecquerel>{};
} // namespace radioactivity_references
namespace references {
using namespace radioactivity_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -137,7 +137,7 @@ constexpr auto operator"" _q_YR(long double l) { return resistance<yottaohm, lon
#ifdef UNITS_REFERENCES
namespace references {
namespace resistance_references {
inline constexpr auto R = reference<dim_resistance, ohm>{};
inline constexpr auto yR = reference<dim_resistance, yoctoohm>{};
@@ -157,6 +157,12 @@ inline constexpr auto ER = reference<dim_resistance, exaohm>{};
inline constexpr auto ZR = reference<dim_resistance, zettaohm>{};
inline constexpr auto YR = reference<dim_resistance, yottaohm>{};
} // namespace resistance_references
namespace references {
using namespace resistance_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -54,10 +54,16 @@ constexpr auto operator"" _q_K(long double l) { return thermodynamic_temperature
#ifdef UNITS_REFERENCES
namespace references {
namespace thermodynamic_temperature_references {
inline constexpr auto K = reference<dim_thermodynamic_temperature, kelvin>{};
} // namespace thermodynamic_temperature_references
namespace references {
using namespace thermodynamic_temperature_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -110,7 +110,7 @@ constexpr auto operator"" _q_d(long double l) { return time<day, long double>(l)
#ifdef UNITS_REFERENCES
namespace references {
namespace time_references {
inline constexpr auto ys = reference<dim_time, yoctosecond>{};
inline constexpr auto zs = reference<dim_time, zeptosecond>{};
@@ -125,7 +125,13 @@ inline constexpr auto min = reference<dim_time, minute>{};
inline constexpr auto h = reference<dim_time, hour>{};
inline constexpr auto d = reference<dim_time, day>{};
} // namespace references
} // namespace time_references
namespace references {
using namespace time_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -157,7 +157,7 @@ constexpr auto operator"" _q_YV(long double l) { return voltage<yottavolt, long
#ifdef UNITS_REFERENCES
namespace references {
namespace voltage_references {
inline constexpr auto V = reference<dim_voltage, volt>{};
inline constexpr auto yV = reference<dim_voltage, yoctovolt>{};
@@ -181,6 +181,12 @@ inline constexpr auto EV = reference<dim_voltage, exavolt>{};
inline constexpr auto ZV = reference<dim_voltage, zettavolt>{};
inline constexpr auto YV = reference<dim_voltage, yottavolt>{};
} // namespace voltage_references
namespace references {
using namespace voltage_references;
} // namespace references
#endif // UNITS_REFERENCES

View File

@@ -261,7 +261,7 @@ constexpr auto operator"" _q_Yl(long double l) { return volume<yottalitre, long
#ifdef UNITS_REFERENCES
namespace references {
namespace volume_references {
inline constexpr auto m3 = reference<dim_volume, cubic_metre>{};
inline constexpr auto ym3 = reference<dim_volume, cubic_yoctometre>{};
@@ -306,6 +306,12 @@ inline constexpr auto El = reference<dim_volume, exalitre>{};
inline constexpr auto Zl = reference<dim_volume, zettalitre>{};
inline constexpr auto Yl = reference<dim_volume, yottalitre>{};
} // namespace volume_references
namespace references {
using namespace volume_references;
} // namespace references
#endif // UNITS_REFERENCES