refactor!: replace one_rep with reference<D, U>

This commit is contained in:
Johel Ernesto Guerrero Peña
2021-03-17 15:20:07 -04:00
committed by Mateusz Pusz
parent bf27b256b2
commit 9a520edfe9
65 changed files with 798 additions and 721 deletions

View File

@ -72,7 +72,6 @@ macro(_set_flags)
set(CLANG_WARNINGS
${GCC_COMMON_WARNINGS}
-Wno-missing-braces
)
set(GCC_WARNINGS

View File

@ -32,11 +32,14 @@ using namespace glide_computer;
auto get_gliders()
{
using namespace si::unit_constants;
UNITS_DIAGNOSTIC_PUSH
UNITS_DIAGNOSTIC_IGNORE_MISSING_BRACES
static const std::array gliders = {
glider{"SZD-30 Pirat", {velocity(83 * km / h), rate_of_climb(-0.7389 * m / s)}},
glider{"SZD-51 Junior", {velocity(80 * km / h), rate_of_climb(-0.6349 * m / s)}},
glider{"SZD-48 Jantar Std 3", {velocity(110 * km / h), rate_of_climb(-0.77355 * m / s)}},
glider{"SZD-56 Diana", {velocity(110 * km / h), rate_of_climb(-0.63657 * m / s)}}};
UNITS_DIAGNOSTIC_POP
return gliders;
}

View File

@ -246,6 +246,22 @@ struct _point_kind_base;
template<typename T>
concept PointKind = kind_impl_<T, detail::_point_kind_base>;
// Reference
namespace detail {
template<typename T>
inline constexpr bool is_reference = false;
} // namespace detail
/**
* @brief A concept matching all references in the library.
*
* Satisfied by all specializations of @c reference.
*/
template<typename T>
concept Reference = detail::is_reference<T>;
// Quantity, QuantityPoint, QuantityKind, QuantityPointKind
namespace detail {

View File

@ -42,13 +42,17 @@
UNITS_PRAGMA(GCC diagnostic ignored "-Wunknown-pragmas") \
UNITS_PRAGMA(GCC diagnostic ignored "-Wunknown-warning-option") \
UNITS_PRAGMA(GCC diagnostic ignored X)
#define UNITS_DIAGNOSTIC_IGNORE_MISSING_BRACES UNITS_DIAGNOSTIC_IGNORE("-Wmissing-braces")
#define UNITS_DIAGNOSTIC_IGNORE_NON_TEMPLATE_FRIEND UNITS_DIAGNOSTIC_IGNORE("-Wnon-template-friend")
#define UNITS_DIAGNOSTIC_IGNORE_SHADOW UNITS_DIAGNOSTIC_IGNORE("-Wshadow")
#else
#define UNITS_DIAGNOSTIC_PUSH UNITS_PRAGMA(warning(push))
#define UNITS_DIAGNOSTIC_POP UNITS_PRAGMA(warning(pop))
#define UNITS_DIAGNOSTIC_IGNORE_PRAGMAS UNITS_PRAGMA(warning(disable : 4068))
#define UNITS_DIAGNOSTIC_IGNORE(X) UNITS_DIAGNOSTIC_IGNORE_PRAGMAS UNITS_PRAGMA(warning(disable : X))
#define UNITS_DIAGNOSTIC_IGNORE_MISSING_BRACES
#define UNITS_DIAGNOSTIC_IGNORE_NON_TEMPLATE_FRIEND
#define UNITS_DIAGNOSTIC_IGNORE_SHADOW
#endif
#if UNITS_COMP_CLANG

View File

@ -44,7 +44,12 @@ inline namespace literals {
constexpr auto operator"" _q_rad(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return angle<radian, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_rad(long double l) { return angle<radian, long double>(l); }
} // namespace literals
inline namespace unit_constants {
inline constexpr auto rad = reference<dim_angle<>, radian>{};
} // namespace unit_constants
} // namespace units

View File

@ -1,124 +0,0 @@
// The MIT License (MIT)
//
// Copyright (c) 2018 Mateusz Pusz
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#pragma once
#include <units/bits/basic_concepts.h>
#include <units/customization_points.h>
#include <type_traits>
namespace units {
struct invalid_one_rep {};
/**
* @brief A representation type to be used for unit constants
*
* This representation type is intended to be used in the unit constants definition:
*
* @code{.cpp}
* namespace unit_constants {
*
* inline constexpr auto m = length<metre, one_rep>{};
* inline constexpr auto km = length<kilometre, one_rep>{};
*
* }
* @endcode
*
* Unit constants simplify quantity creation:
*
* @code{.cpp}
* using namespace units::isq::si::unit_constants;
*
* auto d = 123 * m;
* auto v = 70 * km / h;
* @endcode
*
* Also, it is allowed to define custom unit constants from existing ones:
*
* @code{.cpp}
* constexpr auto Nm = N * m;
* constexpr auto mph = mi / h;
* @endcode
*
* `km * 3` or `s / 4` syntax is not allowed for quantity creation.
*/
struct one_rep {
[[nodiscard]] friend constexpr one_rep operator*(one_rep, one_rep) { return {}; }
[[nodiscard]] friend constexpr one_rep operator/(one_rep, one_rep) { return {}; }
template<QuantityValue Rep>
[[nodiscard]] friend constexpr Rep operator*(const Rep& lhs, one_rep)
{
return lhs;
}
template<QuantityValue Rep>
[[nodiscard]] friend constexpr Rep operator/(const Rep& lhs, one_rep)
{
return lhs;
}
template<QuantityValue Rep>
[[nodiscard]] friend constexpr Rep operator*(one_rep, const Rep&) = delete;
template<QuantityValue Rep>
[[nodiscard]] friend constexpr Rep operator/(one_rep, const Rep&) = delete;
template<typename Rep>
requires requires { quantity_values<Rep>::one(); } &&
(!Quantity<Rep> && !QuantityLike<Rep> && !wrapped_quantity_<Rep>) // TODO: Replace with `QuantityValue`
[[nodiscard]] constexpr operator Rep() const noexcept // when Clang catches up.
{
return quantity_values<Rep>::one();
}
[[nodiscard]] bool operator==(const one_rep&) const = default;
[[nodiscard]] auto operator<=>(const one_rep&) const = default;
[[nodiscard]] constexpr bool operator==(const invalid_one_rep&) const { return false; }
};
template<>
struct quantity_values<one_rep> {
static constexpr invalid_one_rep zero() noexcept { return invalid_one_rep{}; }
static constexpr one_rep one() noexcept { return one_rep{}; }
static constexpr one_rep min() noexcept { return one(); }
static constexpr one_rep max() noexcept { return one(); }
};
} // namespace units
namespace std {
template<>
struct common_type<units::one_rep, units::one_rep> {
using type = units::one_rep;
};
template<units::QuantityValue Rep>
struct common_type<units::one_rep, Rep> {
using type = Rep;
};
template<units::QuantityValue Rep>
struct common_type<Rep, units::one_rep> {
using type = Rep;
};
} // namespace std

View File

@ -24,15 +24,26 @@
#pragma once
#include <units/bits/common_quantity.h>
#include <units/bits/dimension_op.h>
#include <units/bits/pow.h>
#include <units/bits/unit_text.h>
#include <units/generic/dimensionless.h>
#include <units/quantity_cast.h>
#include <units/reference.h>
#include <compare>
#include <utility>
namespace units {
namespace detail {
template<Reference R> // Replace with `v * R{}` pending https://github.com/BobSteagall/wg21/issues/58.
inline constexpr auto make_quantity = [](auto v) {
using Rep = decltype(v);
return quantity<typename R::dimension, typename R::unit, Rep>(std::move(v));
};
} // namespace detail
template<typename T>
concept floating_point_ = // exposition only
(Quantity<T> && treat_as_floating_point<typename T::rep>) ||
@ -98,6 +109,7 @@ class quantity {
Rep value_;
public:
// member types
using reference = units::reference<D, U>;
using dimension = D;
using unit = U;
using rep = Rep;
@ -392,25 +404,41 @@ template<Quantity Q1, QuantityEquivalentTo<Q1> Q2>
return ret(ret(lhs).count() - ret(rhs).count());
}
template<typename D1, typename U1, typename Rep1, typename D2, typename U2, typename Rep2>
requires quantity_value_for_<std::multiplies<>, Rep1, Rep2>
[[nodiscard]] constexpr Quantity auto operator*(const quantity<D1, U1, Rep1>& lhs, const quantity<D2, U2, Rep2>& rhs)
template<typename QuantityOrQuantityValue, typename D, typename U>
requires Quantity<QuantityOrQuantityValue> || QuantityValue<QuantityOrQuantityValue>
[[nodiscard]] constexpr Quantity auto operator*(const QuantityOrQuantityValue& lhs, reference<D, U>)
{
using dim = dimension_multiply<D1, D2>;
using unit = downcast_unit<dim, (U1::ratio / dimension_unit<D1>::ratio) * (U2::ratio / dimension_unit<D2>::ratio) * dimension_unit<dim>::ratio>;
using ret = quantity<dim, unit, std::invoke_result_t<std::multiplies<>, Rep1, Rep2>>;
return ret(lhs.count() * rhs.count());
if constexpr (Quantity<QuantityOrQuantityValue>)
return lhs * quantity<D, U, typename QuantityOrQuantityValue::rep>::one();
else
return quantity<D, U, QuantityOrQuantityValue>(lhs);
}
template<typename D1, typename U1, typename Rep1, typename D2, typename U2, typename Rep2>
requires quantity_value_for_<std::divides<>, Rep1, Rep2>
[[nodiscard]] constexpr Quantity auto operator/(const quantity<D1, U1, Rep1>& lhs, const quantity<D2, U2, Rep2>& rhs)
template<Quantity Q1, Quantity Q2>
requires quantity_value_for_<std::multiplies<>, typename Q1::rep, typename Q2::rep>
[[nodiscard]] constexpr Quantity auto operator*(const Q1& lhs, const Q2& rhs)
{
gsl_ExpectsAudit(rhs.count() != quantity_values<Rep2>::zero());
using dim = dimension_divide<D1, D2>;
using unit = downcast_unit<dim, (U1::ratio / dimension_unit<D1>::ratio) / (U2::ratio / dimension_unit<D2>::ratio) * dimension_unit<dim>::ratio>;
using ret = quantity<dim, unit, std::invoke_result_t<std::divides<>, Rep1, Rep2>>;
return ret(lhs.count() / rhs.count());
return detail::make_quantity<reference_multiply<typename Q1::reference, typename Q2::reference>>(
lhs.count() * rhs.count());
}
template<typename QuantityOrQuantityValue, typename D, typename U>
requires Quantity<QuantityOrQuantityValue> || QuantityValue<QuantityOrQuantityValue>
[[nodiscard]] constexpr Quantity auto operator/(const QuantityOrQuantityValue& lhs, reference<D, U>)
{
if constexpr (Quantity<QuantityOrQuantityValue>)
return lhs / quantity<D, U, typename QuantityOrQuantityValue::rep>::one();
else
return lhs / quantity<D, U, QuantityOrQuantityValue>::one();
}
template<Quantity Q1, Quantity Q2>
requires quantity_value_for_<std::divides<>, typename Q1::rep, typename Q2::rep>
[[nodiscard]] constexpr Quantity auto operator/(const Q1& lhs, const Q2& rhs)
{
gsl_ExpectsAudit(rhs.count() != quantity_values<typename Q2::rep>::zero());
return detail::make_quantity<reference_divide<typename Q1::reference, typename Q2::reference>>(
lhs.count() / rhs.count());
}
template<typename D1, typename U1, typename Rep1, typename U2, typename Rep2>

View File

@ -300,8 +300,9 @@ template<QuantityKind QK1, QuantityKindEquivalentTo<QK1> QK2>
return detail::make_quantity_kind<QK1>(lhs.common() - rhs.common());
}
template<QuantityKind QK, Quantity Q>
[[nodiscard]] constexpr QuantityKind auto operator*(const QK& lhs, const Q& rhs)
template<QuantityKind QK, typename QuantityOrReference>
requires Quantity<QuantityOrReference> || Reference<QuantityOrReference>
[[nodiscard]] constexpr QuantityKind auto operator*(const QK& lhs, const QuantityOrReference& rhs)
requires requires { lhs.common() * rhs; }
{
return detail::downcasted_kind<QK>(lhs.common() * rhs);
@ -321,11 +322,13 @@ template<QuantityKind QK1, QuantityKindRelatedTo<QK1> QK2>
return detail::downcasted_kind<QK1>(lhs.common() * rhs.common());
}
template<QuantityKind QK, Quantity Q>
[[nodiscard]] constexpr QuantityKind auto operator/(const QK& lhs, const Q& rhs)
template<QuantityKind QK, typename QuantityOrReference>
requires Quantity<QuantityOrReference> || Reference<QuantityOrReference>
[[nodiscard]] constexpr QuantityKind auto operator/(const QK& lhs, const QuantityOrReference& rhs)
requires requires { lhs.common() / rhs; }
{
gsl_ExpectsAudit(rhs.count() != quantity_values<typename Q::rep>::zero());
if constexpr (Quantity<QuantityOrReference>)
gsl_ExpectsAudit(rhs.count() != quantity_values<typename QuantityOrReference::rep>::zero());
return detail::downcasted_kind<QK>(lhs.common() / rhs);
}

View File

@ -0,0 +1,108 @@
// The MIT License (MIT)
//
// Copyright (c) 2018 Mateusz Pusz
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#pragma once
#include <units/bits/basic_concepts.h>
#include <units/bits/dimension_op.h>
namespace units {
/**
* @brief The type for unit constants
*
* This type is intended to be used in the unit constants definition:
*
* @code{.cpp}
* namespace unit_constants {
*
* inline constexpr auto m = reference<dim_length, metre>{};
* inline constexpr auto km = reference<dim_length, kilometre>{};
*
* }
* @endcode
*
* Unit constants simplify quantity creation:
*
* @code{.cpp}
* using namespace units::isq::si::unit_constants;
*
* auto d = 123 * m;
* auto v = 70 * km / h;
* @endcode
*
* Also, it is allowed to define custom unit constants from existing ones:
*
* @code{.cpp}
* constexpr auto Nm = N * m;
* constexpr auto mph = mi / h;
* @endcode
*
* `km * 3` or `s / 4` syntax is not allowed for quantity creation.
*/
template<Dimension D, UnitOf<D> U>
struct reference {
using dimension = D;
using unit = U;
};
namespace detail {
template<typename D, typename D1, typename U1, typename D2, typename U2>
using reference_multiply_impl = reference<D, downcast_unit<D,
(U1::ratio / dimension_unit<D1>::ratio) * (U2::ratio / dimension_unit<D2>::ratio) * dimension_unit<D>::ratio>>;
} // namespace detail
template<Reference R1, Reference R2>
using reference_multiply = detail::reference_multiply_impl<
dimension_multiply<typename R1::dimension, typename R2::dimension>,
typename R1::dimension, typename R1::unit, typename R2::dimension, typename R2::unit>;
template<Reference R1, Reference R2>
[[nodiscard]] constexpr reference_multiply<R1, R2> operator*(R1, R2) { return {}; }
namespace detail {
template<typename D, typename D1, typename U1, typename D2, typename U2>
using reference_divide_impl = reference<D, downcast_unit<D,
(U1::ratio / dimension_unit<D1>::ratio) / (U2::ratio / dimension_unit<D2>::ratio) * dimension_unit<D>::ratio>>;
} // namespace detail
template<Reference R1, Reference R2>
using reference_divide = detail::reference_divide_impl<
dimension_divide<typename R1::dimension, typename R2::dimension>,
typename R1::dimension, typename R1::unit, typename R2::dimension, typename R2::unit>;
template<Reference R1, Reference R2>
[[nodiscard]] constexpr reference_divide<R1, R2> operator/(R1, R2) { return {}; }
// type traits
namespace detail {
template<typename D, typename U>
inline constexpr bool is_reference<reference<D, U>> = true;
} // namespace detail
} // namespace units

View File

@ -58,12 +58,12 @@ constexpr auto operator"" _q_Pib_per_s(unsigned long long l) { gsl_ExpectsAudit(
namespace unit_constants {
inline constexpr auto b_per_s = bitrate<bit_per_second, one_rep>{};
inline constexpr auto Kib_per_s = bitrate<kibibit_per_second, one_rep>{};
inline constexpr auto Mib_per_s = bitrate<mebibit_per_second, one_rep>{};
inline constexpr auto Gib_per_s = bitrate<gibibit_per_second, one_rep>{};
inline constexpr auto Tib_per_s = bitrate<tebibit_per_second, one_rep>{};
inline constexpr auto Pib_per_s = bitrate<pebibit_per_second, one_rep>{};
inline constexpr auto b_per_s = reference<dim_bitrate, bit_per_second>{};
inline constexpr auto Kib_per_s = reference<dim_bitrate, kibibit_per_second>{};
inline constexpr auto Mib_per_s = reference<dim_bitrate, mebibit_per_second>{};
inline constexpr auto Gib_per_s = reference<dim_bitrate, gibibit_per_second>{};
inline constexpr auto Tib_per_s = reference<dim_bitrate, tebibit_per_second>{};
inline constexpr auto Pib_per_s = reference<dim_bitrate, pebibit_per_second>{};
} // namespace unit_constants

View File

@ -22,7 +22,7 @@
#pragma once
#include <units/one_rep.h>
#include <units/reference.h>
#include <units/base_dimension.h>
#include <units/data/prefixes.h>
#include <units/unit.h>
@ -74,19 +74,19 @@ constexpr auto operator"" _q_PiB(unsigned long long l) { gsl_ExpectsAudit(std::i
namespace unit_constants {
inline constexpr auto b = information<bit, one_rep>{};
inline constexpr auto Kib = information<kibibit, one_rep>{};
inline constexpr auto Mib = information<mebibit, one_rep>{};
inline constexpr auto Gib = information<gibibit, one_rep>{};
inline constexpr auto Tib = information<tebibit, one_rep>{};
inline constexpr auto Pib = information<pebibit, one_rep>{};
inline constexpr auto b = reference<dim_information, bit>{};
inline constexpr auto Kib = reference<dim_information, kibibit>{};
inline constexpr auto Mib = reference<dim_information, mebibit>{};
inline constexpr auto Gib = reference<dim_information, gibibit>{};
inline constexpr auto Tib = reference<dim_information, tebibit>{};
inline constexpr auto Pib = reference<dim_information, pebibit>{};
inline constexpr auto B = information<byte, one_rep>{};
inline constexpr auto KiB = information<kibibyte, one_rep>{};
inline constexpr auto MiB = information<mebibyte, one_rep>{};
inline constexpr auto GiB = information<gibibyte, one_rep>{};
inline constexpr auto TiB = information<tebibyte, one_rep>{};
inline constexpr auto PiB = information<pebibyte, one_rep>{};
inline constexpr auto B = reference<dim_information, byte>{};
inline constexpr auto KiB = reference<dim_information, kibibyte>{};
inline constexpr auto MiB = reference<dim_information, mebibyte>{};
inline constexpr auto GiB = reference<dim_information, gibibyte>{};
inline constexpr auto TiB = reference<dim_information, tebibyte>{};
inline constexpr auto PiB = reference<dim_information, pebibyte>{};
} // namespace unit_constants

View File

@ -44,7 +44,7 @@ constexpr auto operator"" _q_Gal(long double l) { return acceleration<gal, long
namespace unit_constants {
inline constexpr auto Gal = acceleration<gal, one_rep>{};
inline constexpr auto Gal = reference<dim_acceleration, gal>{};
} // namespace unit_constants

View File

@ -45,7 +45,7 @@ constexpr auto operator"" _q_cm2(long double l) { return area<square_centimetre,
namespace unit_constants {
inline constexpr auto cm2 = area<square_centimetre, one_rep>{};
inline constexpr auto cm2 = reference<dim_area, square_centimetre>{};
} // namespace unit_constants

View File

@ -46,7 +46,7 @@ constexpr auto operator"" _q_erg(long double l) { return energy<erg, long double
namespace unit_constants {
inline constexpr auto erg = energy<cgs::erg, one_rep>{};
inline constexpr auto erg = reference<dim_energy, cgs::erg>{};
} // namespace unit_constants

View File

@ -47,7 +47,7 @@ constexpr auto operator"" _q_dyn(long double l) { return force<dyne, long double
namespace unit_constants {
inline constexpr auto dyn = force<dyne, one_rep>{};
inline constexpr auto dyn = reference<dim_force, dyne>{};
} // namespace unit_constants

View File

@ -44,7 +44,7 @@ constexpr auto operator"" _q_cm(long double l) { return length<centimetre, long
namespace unit_constants {
inline constexpr auto cm = length<centimetre, one_rep>{};
inline constexpr auto cm = reference<dim_length, centimetre>{};
} // namespace unit_constants

View File

@ -44,7 +44,7 @@ constexpr auto operator"" _q_g(long double l) { return mass<gram, long double>(l
namespace unit_constants {
inline constexpr auto g = mass<gram, one_rep>{};
inline constexpr auto g = reference<dim_mass, gram>{};
} // namespace unit_constants

View File

@ -47,7 +47,7 @@ constexpr auto operator"" _q_Ba(long double l) { return pressure<barye, long dou
namespace unit_constants {
inline constexpr auto Ba = pressure<barye, one_rep>{};
inline constexpr auto Ba = reference<dim_pressure, barye>{};
} // namespace unit_constants

View File

@ -45,7 +45,7 @@ constexpr auto operator"" _q_ft2(long double l) { return area<square_foot, long
namespace unit_constants {
inline constexpr auto ft2 = area<square_foot, one_rep>{};
inline constexpr auto ft2 = reference<dim_area, square_foot>{};
} // namespace unit_constants

View File

@ -57,8 +57,8 @@ constexpr auto operator"" _q_ft_lbf(long double l) { return energy<foot_pound_fo
namespace unit_constants {
inline constexpr auto ft_pdl = energy<foot_poundal, one_rep>{};
inline constexpr auto ft_lbf = energy<foot_pound_force, one_rep>{};
inline constexpr auto ft_pdl = reference<dim_energy, foot_poundal>{};
inline constexpr auto ft_lbf = reference<dim_energy, foot_pound_force>{};
} // namespace unit_constants

View File

@ -64,9 +64,9 @@ constexpr auto operator"" _q_klbf(long double l) { return force<kilopound_force,
namespace unit_constants {
inline constexpr auto pdl = force<poundal, one_rep>{};
inline constexpr auto lbf = force<pound_force, one_rep>{};
inline constexpr auto klbf = force<kilopound_force, one_rep>{};
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 unit_constants

View File

@ -95,16 +95,16 @@ constexpr auto operator"" _q_naut_mi(long double l) { return length<nautical_mil
namespace unit_constants {
inline constexpr auto thou = length<thousandth, one_rep>{};
inline constexpr auto thou = reference<dim_length, thousandth>{};
inline constexpr auto mil = thou;
inline constexpr auto in = length<inch, one_rep>{};
inline constexpr auto ft = length<foot, one_rep>{};
inline constexpr auto yd = length<yard, one_rep>{};
inline constexpr auto ftm = length<fathom, one_rep>{};
inline constexpr auto kyd = length<kiloyard, one_rep>{};
inline constexpr auto mile = length<fps::mile, one_rep>{};
inline constexpr auto naut_mi = length<nautical_mile, one_rep>{};
inline constexpr auto in = reference<dim_length, inch>{};
inline constexpr auto ft = reference<dim_length, foot>{};
inline constexpr auto yd = reference<dim_length, yard>{};
inline constexpr auto ftm = reference<dim_length, fathom>{};
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 unit_constants

View File

@ -93,15 +93,15 @@ constexpr auto operator"" _q_lton(long double l) { return mass<long_ton, long do
namespace unit_constants {
inline constexpr auto gr = mass<grain, one_rep>{};
inline constexpr auto dr = mass<dram, one_rep>{};
inline constexpr auto oz = mass<ounce, one_rep>{};
inline constexpr auto lb = mass<pound, one_rep>{};
inline constexpr auto st = mass<stone, one_rep>{};
inline constexpr auto qr = mass<quarter, one_rep>{};
inline constexpr auto cwt = mass<hundredweight, one_rep>{};
inline constexpr auto ston = mass<short_ton, one_rep>{};
inline constexpr auto lton = mass<long_ton, one_rep>{};
inline constexpr auto gr = reference<dim_mass, grain>{};
inline constexpr auto dr = reference<dim_mass, dram>{};
inline constexpr auto oz = reference<dim_mass, ounce>{};
inline constexpr auto lb = reference<dim_mass, pound>{};
inline constexpr auto st = reference<dim_mass, stone>{};
inline constexpr auto qr = reference<dim_mass, quarter>{};
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 unit_constants

View File

@ -58,7 +58,7 @@ constexpr auto operator"" _q_hp(long double l) { return power<horse_power, long
namespace unit_constants {
inline constexpr auto hp = power<horse_power, one_rep>{};
inline constexpr auto hp = reference<dim_power, horse_power>{};
} // namespace unit_constants

View File

@ -61,8 +61,8 @@ constexpr auto operator"" _q_kpsi(long double l) { return pressure<kilopound_for
namespace unit_constants {
inline constexpr auto psi = pressure<pound_force_per_inch_sq, one_rep>{};
inline constexpr auto kpsi = pressure<kilopound_force_per_inch_sq, one_rep>{};
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 unit_constants

View File

@ -60,8 +60,8 @@ constexpr auto operator"" _q_knot(long double l) { return speed<knot, long doubl
namespace unit_constants {
inline constexpr auto mph = speed<mile_per_hour, one_rep>{};
inline constexpr auto knot = speed<fps::knot, one_rep>{};
inline constexpr auto mph = reference<dim_speed, mile_per_hour>{};
inline constexpr auto knot = reference<dim_speed, fps::knot>{};
} // namespace unit_constants

View File

@ -50,8 +50,8 @@ constexpr auto operator"" _q_yd3(long double l) { return volume<cubic_yard, long
namespace unit_constants {
inline constexpr auto ft3 = volume<cubic_foot, one_rep>{};
inline constexpr auto yd3 = volume<cubic_yard, one_rep>{};
inline constexpr auto ft3 = reference<dim_volume, cubic_foot>{};
inline constexpr auto yd3 = reference<dim_volume, cubic_yard>{};
} // namespace unit_constants

View File

@ -54,9 +54,9 @@ constexpr auto operator"" _q_angstrom(long double l) { return si::length<angstro
namespace unit_constants {
inline constexpr auto ly = si::length<light_year, one_rep>{};
inline constexpr auto pc = si::length<parsec, one_rep>{};
inline constexpr auto angstrom = si::length<iau::angstrom, one_rep>{};
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 unit_constants

View File

@ -46,8 +46,8 @@ constexpr auto operator"" _q_rd(long double l) { return si::length<rod, long dou
namespace unit_constants {
inline constexpr auto ch = si::length<chain, one_rep>{};
inline constexpr auto rd = si::length<rod, one_rep>{};
inline constexpr auto ch = reference<si::dim_length, chain>{};
inline constexpr auto rd = reference<si::dim_length, rod>{};
} // namespace unit_constants

View File

@ -39,7 +39,7 @@ constexpr auto operator"" _q_ft2(long double l) { return si::area<square_foot, l
namespace unit_constants {
inline constexpr auto ft2 = si::area<square_foot, one_rep>{};
inline constexpr auto ft2 = reference<si::dim_area, square_foot>{};
} // namespace unit_constants

View File

@ -96,14 +96,14 @@ constexpr auto operator"" _q_mil(long double l) { return si::length<mil, long do
namespace unit_constants {
inline constexpr auto yd = si::length<yard, one_rep>{};
inline constexpr auto ft = si::length<foot, one_rep>{};
inline constexpr auto fathom = si::length<international::fathom, one_rep>{};
inline constexpr auto in = si::length<inch, one_rep>{};
inline constexpr auto mi = si::length<mile, one_rep>{};
inline constexpr auto mi_naut = si::length<nautical_mile, one_rep>{};
inline constexpr auto thou = si::length<international::thou, one_rep>{};
inline constexpr auto mil = si::length<international::mil, one_rep>{};
inline constexpr auto yd = reference<si::dim_length, yard>{};
inline constexpr auto ft = reference<si::dim_length, foot>{};
inline constexpr auto fathom = reference<si::dim_length, international::fathom>{};
inline constexpr auto in = reference<si::dim_length, inch>{};
inline constexpr auto mi = reference<si::dim_length, mile>{};
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 unit_constants

View File

@ -39,7 +39,7 @@ constexpr auto operator"" _q_ft3(long double l) { return si::volume<cubic_foot,
namespace unit_constants {
inline constexpr auto ft3 = si::volume<cubic_foot, one_rep>{};
inline constexpr auto ft3 = reference<si::dim_volume, cubic_foot>{};
} // namespace unit_constants

View File

@ -55,10 +55,10 @@ constexpr auto operator"" _q_point_prn(long double l) { return si::length<point_
namespace unit_constants {
inline constexpr auto pica_comp = si::length<typographic::pica_comp, one_rep>{};
inline constexpr auto pica_prn = si::length<typographic::pica_prn, one_rep>{};
inline constexpr auto point_comp = si::length<typographic::point_comp, one_rep>{};
inline constexpr auto point_prn = si::length<typographic::point_prn, one_rep>{};
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 unit_constants

View File

@ -55,9 +55,9 @@ constexpr auto operator"" _q_mi_us(long double l) { return si::length<units::isq
namespace unit_constants {
inline constexpr auto ft = si::length<units::isq::si::us::foot, one_rep>{};
inline constexpr auto fathom = si::length<units::isq::si::us::fathom, one_rep>{};
inline constexpr auto mi = si::length<units::isq::si::us::mile, one_rep>{};
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 unit_constants

View File

@ -146,27 +146,27 @@ constexpr auto operator"" _q_YGy(long double l) { return absorbed_dose<yottagray
namespace unit_constants {
inline constexpr auto Gy = absorbed_dose<gray, one_rep>{};
inline constexpr auto yGy = absorbed_dose<yoctogray, one_rep>{};
inline constexpr auto zGy = absorbed_dose<zeptogray, one_rep>{};
inline constexpr auto aGy = absorbed_dose<attogray, one_rep>{};
inline constexpr auto fGy = absorbed_dose<femtogray, one_rep>{};
inline constexpr auto pGy = absorbed_dose<picogray, one_rep>{};
inline constexpr auto nGy = absorbed_dose<nanogray, one_rep>{};
inline constexpr auto uGy = absorbed_dose<microgray, one_rep>{};
inline constexpr auto mGy = absorbed_dose<milligray, one_rep>{};
inline constexpr auto cGy = absorbed_dose<centigray, one_rep>{};
inline constexpr auto dGy = absorbed_dose<decigray, one_rep>{};
inline constexpr auto daGy = absorbed_dose<decagray, one_rep>{};
inline constexpr auto hGy = absorbed_dose<hectogray, one_rep>{};
inline constexpr auto kGy = absorbed_dose<kilogray, one_rep>{};
inline constexpr auto MGy = absorbed_dose<megagray, one_rep>{};
inline constexpr auto GGy = absorbed_dose<gigagray, one_rep>{};
inline constexpr auto TGy = absorbed_dose<teragray, one_rep>{};
inline constexpr auto PGy = absorbed_dose<petagray, one_rep>{};
inline constexpr auto EGy = absorbed_dose<exagray, one_rep>{};
inline constexpr auto ZGy = absorbed_dose<zettagray, one_rep>{};
inline constexpr auto YGy = absorbed_dose<yottagray, one_rep>{};
inline constexpr auto Gy = reference<dim_absorbed_dose, gray>{};
inline constexpr auto yGy = reference<dim_absorbed_dose, yoctogray>{};
inline constexpr auto zGy = reference<dim_absorbed_dose, zeptogray>{};
inline constexpr auto aGy = reference<dim_absorbed_dose, attogray>{};
inline constexpr auto fGy = reference<dim_absorbed_dose, femtogray>{};
inline constexpr auto pGy = reference<dim_absorbed_dose, picogray>{};
inline constexpr auto nGy = reference<dim_absorbed_dose, nanogray>{};
inline constexpr auto uGy = reference<dim_absorbed_dose, microgray>{};
inline constexpr auto mGy = reference<dim_absorbed_dose, milligray>{};
inline constexpr auto cGy = reference<dim_absorbed_dose, centigray>{};
inline constexpr auto dGy = reference<dim_absorbed_dose, decigray>{};
inline constexpr auto daGy = reference<dim_absorbed_dose, decagray>{};
inline constexpr auto hGy = reference<dim_absorbed_dose, hectogray>{};
inline constexpr auto kGy = reference<dim_absorbed_dose, kilogray>{};
inline constexpr auto MGy = reference<dim_absorbed_dose, megagray>{};
inline constexpr auto GGy = reference<dim_absorbed_dose, gigagray>{};
inline constexpr auto TGy = reference<dim_absorbed_dose, teragray>{};
inline constexpr auto PGy = reference<dim_absorbed_dose, petagray>{};
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 unit_constants

View File

@ -22,7 +22,7 @@
#pragma once
#include <units/one_rep.h>
#include <units/reference.h>
#include <units/isq/dimensions/amount_of_substance.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
@ -46,7 +46,7 @@ constexpr auto operator"" _q_mol(long double l) { return amount_of_substance<mol
namespace unit_constants {
inline constexpr auto mol = amount_of_substance<mole, one_rep>{};
inline constexpr auto mol = reference<dim_amount_of_substance, mole>{};
} // namespace unit_constants

View File

@ -151,28 +151,28 @@ constexpr auto operator"" _q_ha(long double l) { return area<hectare, long doubl
namespace unit_constants {
inline constexpr auto m2 = area<square_metre, one_rep>{};
inline constexpr auto ym2 = area<square_yoctometre, one_rep>{};
inline constexpr auto zm2 = area<square_zeptometre, one_rep>{};
inline constexpr auto am2 = area<square_attometre, one_rep>{};
inline constexpr auto fm2 = area<square_femtometre, one_rep>{};
inline constexpr auto pm2 = area<square_picometre, one_rep>{};
inline constexpr auto nm2 = area<square_nanometre, one_rep>{};
inline constexpr auto um2 = area<square_micrometre, one_rep>{};
inline constexpr auto mm2 = area<square_millimetre, one_rep>{};
inline constexpr auto cm2 = area<square_centimetre, one_rep>{};
inline constexpr auto dm2 = area<square_decimetre, one_rep>{};
inline constexpr auto dam2 = area<square_decametre, one_rep>{};
inline constexpr auto hm2 = area<square_hectometre, one_rep>{};
inline constexpr auto km2 = area<square_kilometre, one_rep>{};
inline constexpr auto Mm2 = area<square_megametre, one_rep>{};
inline constexpr auto Gm2 = area<square_gigametre, one_rep>{};
inline constexpr auto Tm2 = area<square_terametre, one_rep>{};
inline constexpr auto Pm2 = area<square_petametre, one_rep>{};
inline constexpr auto Em2 = area<square_exametre, one_rep>{};
inline constexpr auto Zm2 = area<square_zettametre, one_rep>{};
inline constexpr auto Ym2 = area<square_yottametre, one_rep>{};
inline constexpr auto ha = area<hectare, one_rep>{};
inline constexpr auto m2 = reference<dim_area, square_metre>{};
inline constexpr auto ym2 = reference<dim_area, square_yoctometre>{};
inline constexpr auto zm2 = reference<dim_area, square_zeptometre>{};
inline constexpr auto am2 = reference<dim_area, square_attometre>{};
inline constexpr auto fm2 = reference<dim_area, square_femtometre>{};
inline constexpr auto pm2 = reference<dim_area, square_picometre>{};
inline constexpr auto nm2 = reference<dim_area, square_nanometre>{};
inline constexpr auto um2 = reference<dim_area, square_micrometre>{};
inline constexpr auto mm2 = reference<dim_area, square_millimetre>{};
inline constexpr auto cm2 = reference<dim_area, square_centimetre>{};
inline constexpr auto dm2 = reference<dim_area, square_decimetre>{};
inline constexpr auto dam2 = reference<dim_area, square_decametre>{};
inline constexpr auto hm2 = reference<dim_area, square_hectometre>{};
inline constexpr auto km2 = reference<dim_area, square_kilometre>{};
inline constexpr auto Mm2 = reference<dim_area, square_megametre>{};
inline constexpr auto Gm2 = reference<dim_area, square_gigametre>{};
inline constexpr auto Tm2 = reference<dim_area, square_terametre>{};
inline constexpr auto Pm2 = reference<dim_area, square_petametre>{};
inline constexpr auto Em2 = reference<dim_area, square_exametre>{};
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 unit_constants

View File

@ -147,27 +147,27 @@ constexpr auto operator"" _q_YF(long double l) { return capacitance<yottafarad,
namespace unit_constants {
inline constexpr auto F = capacitance<farad, one_rep>{};
inline constexpr auto yF = capacitance<yoctofarad, one_rep>{};
inline constexpr auto zF = capacitance<zeptofarad, one_rep>{};
inline constexpr auto aF = capacitance<attofarad, one_rep>{};
inline constexpr auto fF = capacitance<femtofarad, one_rep>{};
inline constexpr auto pF = capacitance<picofarad, one_rep>{};
inline constexpr auto nF = capacitance<nanofarad, one_rep>{};
inline constexpr auto uF = capacitance<microfarad, one_rep>{};
inline constexpr auto mF = capacitance<millifarad, one_rep>{};
inline constexpr auto cF = capacitance<centifarad, one_rep>{};
inline constexpr auto dF = capacitance<decifarad, one_rep>{};
inline constexpr auto daF = capacitance<decafarad, one_rep>{};
inline constexpr auto hF = capacitance<hectofarad, one_rep>{};
inline constexpr auto kF = capacitance<kilofarad, one_rep>{};
inline constexpr auto MF = capacitance<megafarad, one_rep>{};
inline constexpr auto GF = capacitance<gigafarad, one_rep>{};
inline constexpr auto TF = capacitance<terafarad, one_rep>{};
inline constexpr auto PF = capacitance<petafarad, one_rep>{};
inline constexpr auto EF = capacitance<exafarad, one_rep>{};
inline constexpr auto ZF = capacitance<zettafarad, one_rep>{};
inline constexpr auto YF = capacitance<yottafarad, one_rep>{};
inline constexpr auto F = reference<dim_capacitance, farad>{};
inline constexpr auto yF = reference<dim_capacitance, yoctofarad>{};
inline constexpr auto zF = reference<dim_capacitance, zeptofarad>{};
inline constexpr auto aF = reference<dim_capacitance, attofarad>{};
inline constexpr auto fF = reference<dim_capacitance, femtofarad>{};
inline constexpr auto pF = reference<dim_capacitance, picofarad>{};
inline constexpr auto nF = reference<dim_capacitance, nanofarad>{};
inline constexpr auto uF = reference<dim_capacitance, microfarad>{};
inline constexpr auto mF = reference<dim_capacitance, millifarad>{};
inline constexpr auto cF = reference<dim_capacitance, centifarad>{};
inline constexpr auto dF = reference<dim_capacitance, decifarad>{};
inline constexpr auto daF = reference<dim_capacitance, decafarad>{};
inline constexpr auto hF = reference<dim_capacitance, hectofarad>{};
inline constexpr auto kF = reference<dim_capacitance, kilofarad>{};
inline constexpr auto MF = reference<dim_capacitance, megafarad>{};
inline constexpr auto GF = reference<dim_capacitance, gigafarad>{};
inline constexpr auto TF = reference<dim_capacitance, terafarad>{};
inline constexpr auto PF = reference<dim_capacitance, petafarad>{};
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 unit_constants

View File

@ -153,28 +153,28 @@ constexpr auto operator"" _q_U(long double l) { return catalytic_activity<enzyme
namespace unit_constants {
inline constexpr auto kat = catalytic_activity<katal, one_rep>{};
inline constexpr auto ykat = catalytic_activity<yoctokatal, one_rep>{};
inline constexpr auto zkat = catalytic_activity<zeptokatal, one_rep>{};
inline constexpr auto akat = catalytic_activity<attokatal, one_rep>{};
inline constexpr auto fkat = catalytic_activity<femtokatal, one_rep>{};
inline constexpr auto pkat = catalytic_activity<picokatal, one_rep>{};
inline constexpr auto nkat = catalytic_activity<nanokatal, one_rep>{};
inline constexpr auto ukat = catalytic_activity<microkatal, one_rep>{};
inline constexpr auto mkat = catalytic_activity<millikatal, one_rep>{};
inline constexpr auto ckat = catalytic_activity<centikatal, one_rep>{};
inline constexpr auto dkat = catalytic_activity<decikatal, one_rep>{};
inline constexpr auto dakat = catalytic_activity<decakatal, one_rep>{};
inline constexpr auto hkat = catalytic_activity<hectokatal, one_rep>{};
inline constexpr auto kkat = catalytic_activity<kilokatal, one_rep>{};
inline constexpr auto Mkat = catalytic_activity<megakatal, one_rep>{};
inline constexpr auto Gkat = catalytic_activity<gigakatal, one_rep>{};
inline constexpr auto Tkat = catalytic_activity<terakatal, one_rep>{};
inline constexpr auto Pkat = catalytic_activity<petakatal, one_rep>{};
inline constexpr auto Ekat = catalytic_activity<exakatal, one_rep>{};
inline constexpr auto Zkat = catalytic_activity<zettakatal, one_rep>{};
inline constexpr auto Ykat = catalytic_activity<yottakatal, one_rep>{};
inline constexpr auto U = catalytic_activity<enzyme_unit, one_rep>{};
inline constexpr auto kat = reference<dim_catalytic_activity, katal>{};
inline constexpr auto ykat = reference<dim_catalytic_activity, yoctokatal>{};
inline constexpr auto zkat = reference<dim_catalytic_activity, zeptokatal>{};
inline constexpr auto akat = reference<dim_catalytic_activity, attokatal>{};
inline constexpr auto fkat = reference<dim_catalytic_activity, femtokatal>{};
inline constexpr auto pkat = reference<dim_catalytic_activity, picokatal>{};
inline constexpr auto nkat = reference<dim_catalytic_activity, nanokatal>{};
inline constexpr auto ukat = reference<dim_catalytic_activity, microkatal>{};
inline constexpr auto mkat = reference<dim_catalytic_activity, millikatal>{};
inline constexpr auto ckat = reference<dim_catalytic_activity, centikatal>{};
inline constexpr auto dkat = reference<dim_catalytic_activity, decikatal>{};
inline constexpr auto dakat = reference<dim_catalytic_activity, decakatal>{};
inline constexpr auto hkat = reference<dim_catalytic_activity, hectokatal>{};
inline constexpr auto kkat = reference<dim_catalytic_activity, kilokatal>{};
inline constexpr auto Mkat = reference<dim_catalytic_activity, megakatal>{};
inline constexpr auto Gkat = reference<dim_catalytic_activity, gigakatal>{};
inline constexpr auto Tkat = reference<dim_catalytic_activity, terakatal>{};
inline constexpr auto Pkat = reference<dim_catalytic_activity, petakatal>{};
inline constexpr auto Ekat = reference<dim_catalytic_activity, exakatal>{};
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 unit_constants

View File

@ -126,23 +126,23 @@ constexpr auto operator"" _q_YS(long double l) { return conductance<yottasiemens
namespace unit_constants {
inline constexpr auto S = conductance<siemens, one_rep>{};
inline constexpr auto yS = conductance<yoctosiemens, one_rep>{};
inline constexpr auto zS = conductance<zeptosiemens, one_rep>{};
inline constexpr auto aS = conductance<attosiemens, one_rep>{};
inline constexpr auto fS = conductance<femtosiemens, one_rep>{};
inline constexpr auto pS = conductance<picosiemens, one_rep>{};
inline constexpr auto nS = conductance<nanosiemens, one_rep>{};
inline constexpr auto uS = conductance<microsiemens, one_rep>{};
inline constexpr auto mS = conductance<millisiemens, one_rep>{};
inline constexpr auto kS = conductance<kilosiemens, one_rep>{};
inline constexpr auto MS = conductance<megasiemens, one_rep>{};
inline constexpr auto GS = conductance<gigasiemens, one_rep>{};
inline constexpr auto TS = conductance<terasiemens, one_rep>{};
inline constexpr auto PS = conductance<petasiemens, one_rep>{};
inline constexpr auto ES = conductance<exasiemens, one_rep>{};
inline constexpr auto ZS = conductance<zettasiemens, one_rep>{};
inline constexpr auto YS = conductance<yottasiemens, one_rep>{};
inline constexpr auto S = reference<dim_conductance, siemens>{};
inline constexpr auto yS = reference<dim_conductance, yoctosiemens>{};
inline constexpr auto zS = reference<dim_conductance, zeptosiemens>{};
inline constexpr auto aS = reference<dim_conductance, attosiemens>{};
inline constexpr auto fS = reference<dim_conductance, femtosiemens>{};
inline constexpr auto pS = reference<dim_conductance, picosiemens>{};
inline constexpr auto nS = reference<dim_conductance, nanosiemens>{};
inline constexpr auto uS = reference<dim_conductance, microsiemens>{};
inline constexpr auto mS = reference<dim_conductance, millisiemens>{};
inline constexpr auto kS = reference<dim_conductance, kilosiemens>{};
inline constexpr auto MS = reference<dim_conductance, megasiemens>{};
inline constexpr auto GS = reference<dim_conductance, gigasiemens>{};
inline constexpr auto TS = reference<dim_conductance, terasiemens>{};
inline constexpr auto PS = reference<dim_conductance, petasiemens>{};
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 unit_constants

View File

@ -45,7 +45,7 @@ constexpr auto operator"" _q_Pa_s(long double l) { return dynamic_viscosity<pasc
namespace unit_constants {
inline constexpr auto Pa_s = dynamic_viscosity<pascal_second, one_rep>{};
inline constexpr auto Pa_s = reference<dim_dynamic_viscosity, pascal_second>{};
} // namespace unit_constants

View File

@ -46,7 +46,7 @@ constexpr auto operator"" _q_C(long double l) { return electric_charge<coulomb,
namespace unit_constants {
inline constexpr auto C = electric_charge<coulomb, one_rep>{};
inline constexpr auto C = reference<dim_electric_charge, coulomb>{};
} // namespace unit_constants

View File

@ -22,7 +22,7 @@
#pragma once
#include <units/one_rep.h>
#include <units/reference.h>
#include <units/isq/dimensions/electric_current.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
@ -146,27 +146,27 @@ constexpr auto operator"" _q_YA(long double l) { return electric_current<yottaam
namespace unit_constants {
inline constexpr auto A = electric_current<ampere, one_rep>{};
inline constexpr auto yA = electric_current<yoctoampere, one_rep>{};
inline constexpr auto zA = electric_current<zeptoampere, one_rep>{};
inline constexpr auto aA = electric_current<attoampere, one_rep>{};
inline constexpr auto fA = electric_current<femtoampere, one_rep>{};
inline constexpr auto pA = electric_current<picoampere, one_rep>{};
inline constexpr auto nA = electric_current<nanoampere, one_rep>{};
inline constexpr auto uA = electric_current<microampere, one_rep>{};
inline constexpr auto mA = electric_current<milliampere, one_rep>{};
inline constexpr auto cA = electric_current<centiampere, one_rep>{};
inline constexpr auto dA = electric_current<deciampere, one_rep>{};
inline constexpr auto daA = electric_current<decaampere, one_rep>{};
inline constexpr auto hA = electric_current<hectoampere, one_rep>{};
inline constexpr auto kA = electric_current<kiloampere, one_rep>{};
inline constexpr auto MA = electric_current<megaampere, one_rep>{};
inline constexpr auto GA = electric_current<gigaampere, one_rep>{};
inline constexpr auto TA = electric_current<teraampere, one_rep>{};
inline constexpr auto PA = electric_current<petaampere, one_rep>{};
inline constexpr auto EA = electric_current<exaampere, one_rep>{};
inline constexpr auto ZA = electric_current<zettaampere, one_rep>{};
inline constexpr auto YA = electric_current<yottaampere, one_rep>{};
inline constexpr auto A = reference<dim_electric_current, ampere>{};
inline constexpr auto yA = reference<dim_electric_current, yoctoampere>{};
inline constexpr auto zA = reference<dim_electric_current, zeptoampere>{};
inline constexpr auto aA = reference<dim_electric_current, attoampere>{};
inline constexpr auto fA = reference<dim_electric_current, femtoampere>{};
inline constexpr auto pA = reference<dim_electric_current, picoampere>{};
inline constexpr auto nA = reference<dim_electric_current, nanoampere>{};
inline constexpr auto uA = reference<dim_electric_current, microampere>{};
inline constexpr auto mA = reference<dim_electric_current, milliampere>{};
inline constexpr auto cA = reference<dim_electric_current, centiampere>{};
inline constexpr auto dA = reference<dim_electric_current, deciampere>{};
inline constexpr auto daA = reference<dim_electric_current, decaampere>{};
inline constexpr auto hA = reference<dim_electric_current, hectoampere>{};
inline constexpr auto kA = reference<dim_electric_current, kiloampere>{};
inline constexpr auto MA = reference<dim_electric_current, megaampere>{};
inline constexpr auto GA = reference<dim_electric_current, gigaampere>{};
inline constexpr auto TA = reference<dim_electric_current, teraampere>{};
inline constexpr auto PA = reference<dim_electric_current, petaampere>{};
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 unit_constants

View File

@ -137,25 +137,25 @@ constexpr auto operator"" _q_GeV(long double l) { return energy<gigaelectronvolt
namespace unit_constants {
inline constexpr auto J = energy<joule, one_rep>{};
inline constexpr auto yJ = energy<yoctojoule, one_rep>{};
inline constexpr auto zJ = energy<zeptojoule, one_rep>{};
inline constexpr auto aJ = energy<attojoule, one_rep>{};
inline constexpr auto fJ = energy<femtojoule, one_rep>{};
inline constexpr auto pJ = energy<picojoule, one_rep>{};
inline constexpr auto nJ = energy<nanojoule, one_rep>{};
inline constexpr auto uJ = energy<microjoule, one_rep>{};
inline constexpr auto mJ = energy<millijoule, one_rep>{};
inline constexpr auto kJ = energy<kilojoule, one_rep>{};
inline constexpr auto MJ = energy<megajoule, one_rep>{};
inline constexpr auto GJ = energy<gigajoule, one_rep>{};
inline constexpr auto TJ = energy<terajoule, one_rep>{};
inline constexpr auto PJ = energy<petajoule, one_rep>{};
inline constexpr auto EJ = energy<exajoule, one_rep>{};
inline constexpr auto ZJ = energy<zettajoule, one_rep>{};
inline constexpr auto YJ = energy<yottajoule, one_rep>{};
inline constexpr auto eV = energy<electronvolt, one_rep>{};
inline constexpr auto GeV = energy<gigaelectronvolt, one_rep>{};
inline constexpr auto J = reference<dim_energy, joule>{};
inline constexpr auto yJ = reference<dim_energy, yoctojoule>{};
inline constexpr auto zJ = reference<dim_energy, zeptojoule>{};
inline constexpr auto aJ = reference<dim_energy, attojoule>{};
inline constexpr auto fJ = reference<dim_energy, femtojoule>{};
inline constexpr auto pJ = reference<dim_energy, picojoule>{};
inline constexpr auto nJ = reference<dim_energy, nanojoule>{};
inline constexpr auto uJ = reference<dim_energy, microjoule>{};
inline constexpr auto mJ = reference<dim_energy, millijoule>{};
inline constexpr auto kJ = reference<dim_energy, kilojoule>{};
inline constexpr auto MJ = reference<dim_energy, megajoule>{};
inline constexpr auto GJ = reference<dim_energy, gigajoule>{};
inline constexpr auto TJ = reference<dim_energy, terajoule>{};
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 unit_constants

View File

@ -147,27 +147,27 @@ constexpr auto operator"" _q_YN(long double l) { return force<yottanewton, long
namespace unit_constants {
inline constexpr auto N = force<newton, one_rep>{};
inline constexpr auto yN = force<yoctonewton, one_rep>{};
inline constexpr auto zN = force<zeptonewton, one_rep>{};
inline constexpr auto aN = force<attonewton, one_rep>{};
inline constexpr auto fN = force<femtonewton, one_rep>{};
inline constexpr auto pN = force<piconewton, one_rep>{};
inline constexpr auto nN = force<nanonewton, one_rep>{};
inline constexpr auto uN = force<micronewton, one_rep>{};
inline constexpr auto mN = force<millinewton, one_rep>{};
inline constexpr auto cN = force<centinewton, one_rep>{};
inline constexpr auto dN = force<decinewton, one_rep>{};
inline constexpr auto daN = force<decanewton, one_rep>{};
inline constexpr auto hN = force<hectonewton, one_rep>{};
inline constexpr auto kN = force<kilonewton, one_rep>{};
inline constexpr auto MN = force<meganewton, one_rep>{};
inline constexpr auto GN = force<giganewton, one_rep>{};
inline constexpr auto TN = force<teranewton, one_rep>{};
inline constexpr auto PN = force<petanewton, one_rep>{};
inline constexpr auto EN = force<exanewton, one_rep>{};
inline constexpr auto ZN = force<zettanewton, one_rep>{};
inline constexpr auto YN = force<yottanewton, one_rep>{};
inline constexpr auto N = reference<dim_force, newton>{};
inline constexpr auto yN = reference<dim_force, yoctonewton>{};
inline constexpr auto zN = reference<dim_force, zeptonewton>{};
inline constexpr auto aN = reference<dim_force, attonewton>{};
inline constexpr auto fN = reference<dim_force, femtonewton>{};
inline constexpr auto pN = reference<dim_force, piconewton>{};
inline constexpr auto nN = reference<dim_force, nanonewton>{};
inline constexpr auto uN = reference<dim_force, micronewton>{};
inline constexpr auto mN = reference<dim_force, millinewton>{};
inline constexpr auto cN = reference<dim_force, centinewton>{};
inline constexpr auto dN = reference<dim_force, decinewton>{};
inline constexpr auto daN = reference<dim_force, decanewton>{};
inline constexpr auto hN = reference<dim_force, hectonewton>{};
inline constexpr auto kN = reference<dim_force, kilonewton>{};
inline constexpr auto MN = reference<dim_force, meganewton>{};
inline constexpr auto GN = reference<dim_force, giganewton>{};
inline constexpr auto TN = reference<dim_force, teranewton>{};
inline constexpr auto PN = reference<dim_force, petanewton>{};
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 unit_constants

View File

@ -125,23 +125,23 @@ constexpr auto operator"" _q_YHz(long double l) { return frequency<yottahertz, l
namespace unit_constants {
inline constexpr auto Hz = frequency<hertz, one_rep>{};
inline constexpr auto yHz = frequency<yoctohertz, one_rep>{};
inline constexpr auto zHz = frequency<zeptohertz, one_rep>{};
inline constexpr auto aHz = frequency<attohertz, one_rep>{};
inline constexpr auto fHz = frequency<femtohertz, one_rep>{};
inline constexpr auto pHz = frequency<picohertz, one_rep>{};
inline constexpr auto nHz = frequency<nanohertz, one_rep>{};
inline constexpr auto uHz = frequency<microhertz, one_rep>{};
inline constexpr auto mHz = frequency<millihertz, one_rep>{};
inline constexpr auto kHz = frequency<kilohertz, one_rep>{};
inline constexpr auto MHz = frequency<megahertz, one_rep>{};
inline constexpr auto GHz = frequency<gigahertz, one_rep>{};
inline constexpr auto THz = frequency<terahertz, one_rep>{};
inline constexpr auto PHz = frequency<petahertz, one_rep>{};
inline constexpr auto EHz = frequency<exahertz, one_rep>{};
inline constexpr auto ZHz = frequency<zettahertz, one_rep>{};
inline constexpr auto YHz = frequency<yottahertz, one_rep>{};
inline constexpr auto Hz = reference<dim_frequency, hertz>{};
inline constexpr auto yHz = reference<dim_frequency, yoctohertz>{};
inline constexpr auto zHz = reference<dim_frequency, zeptohertz>{};
inline constexpr auto aHz = reference<dim_frequency, attohertz>{};
inline constexpr auto fHz = reference<dim_frequency, femtohertz>{};
inline constexpr auto pHz = reference<dim_frequency, picohertz>{};
inline constexpr auto nHz = reference<dim_frequency, nanohertz>{};
inline constexpr auto uHz = reference<dim_frequency, microhertz>{};
inline constexpr auto mHz = reference<dim_frequency, millihertz>{};
inline constexpr auto kHz = reference<dim_frequency, kilohertz>{};
inline constexpr auto MHz = reference<dim_frequency, megahertz>{};
inline constexpr auto GHz = reference<dim_frequency, gigahertz>{};
inline constexpr auto THz = reference<dim_frequency, terahertz>{};
inline constexpr auto PHz = reference<dim_frequency, petahertz>{};
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 unit_constants

View File

@ -127,23 +127,23 @@ constexpr auto operator"" _q_YH(long double l) { return inductance<yottahenry, l
namespace unit_constants {
inline constexpr auto H = inductance<henry, one_rep>{};
inline constexpr auto yH = inductance<yoctohenry, one_rep>{};
inline constexpr auto zH = inductance<zeptohenry, one_rep>{};
inline constexpr auto aH = inductance<attohenry, one_rep>{};
inline constexpr auto fH = inductance<femtohenry, one_rep>{};
inline constexpr auto pH = inductance<picohenry, one_rep>{};
inline constexpr auto nH = inductance<nanohenry, one_rep>{};
inline constexpr auto uH = inductance<microhenry, one_rep>{};
inline constexpr auto mH = inductance<millihenry, one_rep>{};
inline constexpr auto kH = inductance<kilohenry, one_rep>{};
inline constexpr auto MH = inductance<megahenry, one_rep>{};
inline constexpr auto GH = inductance<gigahenry, one_rep>{};
inline constexpr auto TH = inductance<terahenry, one_rep>{};
inline constexpr auto PH = inductance<petahenry, one_rep>{};
inline constexpr auto EH = inductance<exahenry, one_rep>{};
inline constexpr auto ZH = inductance<zettahenry, one_rep>{};
inline constexpr auto YH = inductance<yottahenry, one_rep>{};
inline constexpr auto H = reference<dim_inductance, henry>{};
inline constexpr auto yH = reference<dim_inductance, yoctohenry>{};
inline constexpr auto zH = reference<dim_inductance, zeptohenry>{};
inline constexpr auto aH = reference<dim_inductance, attohenry>{};
inline constexpr auto fH = reference<dim_inductance, femtohenry>{};
inline constexpr auto pH = reference<dim_inductance, picohenry>{};
inline constexpr auto nH = reference<dim_inductance, nanohenry>{};
inline constexpr auto uH = reference<dim_inductance, microhenry>{};
inline constexpr auto mH = reference<dim_inductance, millihenry>{};
inline constexpr auto kH = reference<dim_inductance, kilohenry>{};
inline constexpr auto MH = reference<dim_inductance, megahenry>{};
inline constexpr auto GH = reference<dim_inductance, gigahenry>{};
inline constexpr auto TH = reference<dim_inductance, terahenry>{};
inline constexpr auto PH = reference<dim_inductance, petahenry>{};
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 unit_constants

View File

@ -22,7 +22,7 @@
#pragma once
#include <units/one_rep.h>
#include <units/reference.h>
#include <units/isq/dimensions/length.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
@ -152,28 +152,28 @@ constexpr auto operator"" _q_au(long double l) { return length<astronomical_unit
namespace unit_constants {
inline constexpr auto m = length<metre, one_rep>{};
inline constexpr auto ym = length<yoctometre, one_rep>{};
inline constexpr auto zm = length<zeptometre, one_rep>{};
inline constexpr auto am = length<attometre, one_rep>{};
inline constexpr auto fm = length<femtometre, one_rep>{};
inline constexpr auto pm = length<picometre, one_rep>{};
inline constexpr auto nm = length<nanometre, one_rep>{};
inline constexpr auto um = length<micrometre, one_rep>{};
inline constexpr auto mm = length<millimetre, one_rep>{};
inline constexpr auto cm = length<centimetre, one_rep>{};
inline constexpr auto dm = length<decimetre, one_rep>{};
inline constexpr auto dam = length<decametre, one_rep>{};
inline constexpr auto hm = length<hectometre, one_rep>{};
inline constexpr auto km = length<kilometre, one_rep>{};
inline constexpr auto Mm = length<megametre, one_rep>{};
inline constexpr auto Gm = length<gigametre, one_rep>{};
inline constexpr auto Tm = length<terametre, one_rep>{};
inline constexpr auto Pm = length<petametre, one_rep>{};
inline constexpr auto Em = length<exametre, one_rep>{};
inline constexpr auto Zm = length<zettametre, one_rep>{};
inline constexpr auto Ym = length<yottametre, one_rep>{};
inline constexpr auto au = length<astronomical_unit, one_rep>{};
inline constexpr auto m = reference<dim_length, metre>{};
inline constexpr auto ym = reference<dim_length, yoctometre>{};
inline constexpr auto zm = reference<dim_length, zeptometre>{};
inline constexpr auto am = reference<dim_length, attometre>{};
inline constexpr auto fm = reference<dim_length, femtometre>{};
inline constexpr auto pm = reference<dim_length, picometre>{};
inline constexpr auto nm = reference<dim_length, nanometre>{};
inline constexpr auto um = reference<dim_length, micrometre>{};
inline constexpr auto mm = reference<dim_length, millimetre>{};
inline constexpr auto cm = reference<dim_length, centimetre>{};
inline constexpr auto dm = reference<dim_length, decimetre>{};
inline constexpr auto dam = reference<dim_length, decametre>{};
inline constexpr auto hm = reference<dim_length, hectometre>{};
inline constexpr auto km = reference<dim_length, kilometre>{};
inline constexpr auto Mm = reference<dim_length, megametre>{};
inline constexpr auto Gm = reference<dim_length, gigametre>{};
inline constexpr auto Tm = reference<dim_length, terametre>{};
inline constexpr auto Pm = reference<dim_length, petametre>{};
inline constexpr auto Em = reference<dim_length, exametre>{};
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 unit_constants

View File

@ -22,7 +22,7 @@
#pragma once
#include <units/one_rep.h>
#include <units/reference.h>
#include <units/isq/dimensions/luminous_intensity.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
@ -146,27 +146,27 @@ constexpr auto operator"" _q_Ycd(long double l) { return luminous_intensity<yott
namespace unit_constants {
inline constexpr auto cd = luminous_intensity<candela, one_rep>{};
inline constexpr auto ycd = luminous_intensity<yoctocandela, one_rep>{};
inline constexpr auto zcd = luminous_intensity<zeptocandela, one_rep>{};
inline constexpr auto acd = luminous_intensity<attocandela, one_rep>{};
inline constexpr auto fcd = luminous_intensity<femtocandela, one_rep>{};
inline constexpr auto pcd = luminous_intensity<picocandela, one_rep>{};
inline constexpr auto ncd = luminous_intensity<nanocandela, one_rep>{};
inline constexpr auto ucd = luminous_intensity<microcandela, one_rep>{};
inline constexpr auto mcd = luminous_intensity<millicandela, one_rep>{};
inline constexpr auto ccd = luminous_intensity<centicandela, one_rep>{};
inline constexpr auto dcd = luminous_intensity<decicandela, one_rep>{};
inline constexpr auto dacd = luminous_intensity<decacandela, one_rep>{};
inline constexpr auto hcd = luminous_intensity<hectocandela, one_rep>{};
inline constexpr auto kcd = luminous_intensity<kilocandela, one_rep>{};
inline constexpr auto Mcd = luminous_intensity<megacandela, one_rep>{};
inline constexpr auto Gcd = luminous_intensity<gigacandela, one_rep>{};
inline constexpr auto Tcd = luminous_intensity<teracandela, one_rep>{};
inline constexpr auto Pcd = luminous_intensity<petacandela, one_rep>{};
inline constexpr auto Ecd = luminous_intensity<exacandela, one_rep>{};
inline constexpr auto Zcd = luminous_intensity<zettacandela, one_rep>{};
inline constexpr auto Ycd = luminous_intensity<yottacandela, one_rep>{};
inline constexpr auto cd = reference<dim_luminous_intensity, candela>{};
inline constexpr auto ycd = reference<dim_luminous_intensity, yoctocandela>{};
inline constexpr auto zcd = reference<dim_luminous_intensity, zeptocandela>{};
inline constexpr auto acd = reference<dim_luminous_intensity, attocandela>{};
inline constexpr auto fcd = reference<dim_luminous_intensity, femtocandela>{};
inline constexpr auto pcd = reference<dim_luminous_intensity, picocandela>{};
inline constexpr auto ncd = reference<dim_luminous_intensity, nanocandela>{};
inline constexpr auto ucd = reference<dim_luminous_intensity, microcandela>{};
inline constexpr auto mcd = reference<dim_luminous_intensity, millicandela>{};
inline constexpr auto ccd = reference<dim_luminous_intensity, centicandela>{};
inline constexpr auto dcd = reference<dim_luminous_intensity, decicandela>{};
inline constexpr auto dacd = reference<dim_luminous_intensity, decacandela>{};
inline constexpr auto hcd = reference<dim_luminous_intensity, hectocandela>{};
inline constexpr auto kcd = reference<dim_luminous_intensity, kilocandela>{};
inline constexpr auto Mcd = reference<dim_luminous_intensity, megacandela>{};
inline constexpr auto Gcd = reference<dim_luminous_intensity, gigacandela>{};
inline constexpr auto Tcd = reference<dim_luminous_intensity, teracandela>{};
inline constexpr auto Pcd = reference<dim_luminous_intensity, petacandela>{};
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 unit_constants

View File

@ -127,23 +127,23 @@ constexpr auto operator"" _q_YWb(long double l) { return magnetic_flux<yottawebe
namespace unit_constants {
inline constexpr auto Wb = magnetic_flux<weber, one_rep>{};
inline constexpr auto yWb = magnetic_flux<yoctoweber, one_rep>{};
inline constexpr auto zWb = magnetic_flux<zeptoweber, one_rep>{};
inline constexpr auto aWb = magnetic_flux<attoweber, one_rep>{};
inline constexpr auto fWb = magnetic_flux<femtoweber, one_rep>{};
inline constexpr auto pWb = magnetic_flux<picoweber, one_rep>{};
inline constexpr auto nWb = magnetic_flux<nanoweber, one_rep>{};
inline constexpr auto uWb = magnetic_flux<microweber, one_rep>{};
inline constexpr auto mWb = magnetic_flux<milliweber, one_rep>{};
inline constexpr auto kWb = magnetic_flux<kiloweber, one_rep>{};
inline constexpr auto MWb = magnetic_flux<megaweber, one_rep>{};
inline constexpr auto GWb = magnetic_flux<gigaweber, one_rep>{};
inline constexpr auto TWb = magnetic_flux<teraweber, one_rep>{};
inline constexpr auto PWb = magnetic_flux<petaweber, one_rep>{};
inline constexpr auto EWb = magnetic_flux<exaweber, one_rep>{};
inline constexpr auto ZWb = magnetic_flux<zettaweber, one_rep>{};
inline constexpr auto YWb = magnetic_flux<yottaweber, one_rep>{};
inline constexpr auto Wb = reference<dim_magnetic_flux, weber>{};
inline constexpr auto yWb = reference<dim_magnetic_flux, yoctoweber>{};
inline constexpr auto zWb = reference<dim_magnetic_flux, zeptoweber>{};
inline constexpr auto aWb = reference<dim_magnetic_flux, attoweber>{};
inline constexpr auto fWb = reference<dim_magnetic_flux, femtoweber>{};
inline constexpr auto pWb = reference<dim_magnetic_flux, picoweber>{};
inline constexpr auto nWb = reference<dim_magnetic_flux, nanoweber>{};
inline constexpr auto uWb = reference<dim_magnetic_flux, microweber>{};
inline constexpr auto mWb = reference<dim_magnetic_flux, milliweber>{};
inline constexpr auto kWb = reference<dim_magnetic_flux, kiloweber>{};
inline constexpr auto MWb = reference<dim_magnetic_flux, megaweber>{};
inline constexpr auto GWb = reference<dim_magnetic_flux, gigaweber>{};
inline constexpr auto TWb = reference<dim_magnetic_flux, teraweber>{};
inline constexpr auto PWb = reference<dim_magnetic_flux, petaweber>{};
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 unit_constants

View File

@ -135,24 +135,24 @@ constexpr auto operator"" _q_G(long double l) { return magnetic_induction<gauss,
namespace unit_constants {
inline constexpr auto T = magnetic_induction<tesla, one_rep>{};
inline constexpr auto yT = magnetic_induction<yoctotesla, one_rep>{};
inline constexpr auto zT = magnetic_induction<zeptotesla, one_rep>{};
inline constexpr auto aT = magnetic_induction<attotesla, one_rep>{};
inline constexpr auto fT = magnetic_induction<femtotesla, one_rep>{};
inline constexpr auto pT = magnetic_induction<picotesla, one_rep>{};
inline constexpr auto nT = magnetic_induction<nanotesla, one_rep>{};
inline constexpr auto uT = magnetic_induction<microtesla, one_rep>{};
inline constexpr auto mT = magnetic_induction<millitesla, one_rep>{};
inline constexpr auto kT = magnetic_induction<kilotesla, one_rep>{};
inline constexpr auto MT = magnetic_induction<megatesla, one_rep>{};
inline constexpr auto GT = magnetic_induction<gigatesla, one_rep>{};
inline constexpr auto TT = magnetic_induction<teratesla, one_rep>{};
inline constexpr auto PT = magnetic_induction<petatesla, one_rep>{};
inline constexpr auto ET = magnetic_induction<exatesla, one_rep>{};
inline constexpr auto ZT = magnetic_induction<zettatesla, one_rep>{};
inline constexpr auto YT = magnetic_induction<yottatesla, one_rep>{};
inline constexpr auto G = magnetic_induction<gauss, one_rep>{};
inline constexpr auto T = reference<dim_magnetic_induction, tesla>{};
inline constexpr auto yT = reference<dim_magnetic_induction, yoctotesla>{};
inline constexpr auto zT = reference<dim_magnetic_induction, zeptotesla>{};
inline constexpr auto aT = reference<dim_magnetic_induction, attotesla>{};
inline constexpr auto fT = reference<dim_magnetic_induction, femtotesla>{};
inline constexpr auto pT = reference<dim_magnetic_induction, picotesla>{};
inline constexpr auto nT = reference<dim_magnetic_induction, nanotesla>{};
inline constexpr auto uT = reference<dim_magnetic_induction, microtesla>{};
inline constexpr auto mT = reference<dim_magnetic_induction, millitesla>{};
inline constexpr auto kT = reference<dim_magnetic_induction, kilotesla>{};
inline constexpr auto MT = reference<dim_magnetic_induction, megatesla>{};
inline constexpr auto GT = reference<dim_magnetic_induction, gigatesla>{};
inline constexpr auto TT = reference<dim_magnetic_induction, teratesla>{};
inline constexpr auto PT = reference<dim_magnetic_induction, petatesla>{};
inline constexpr auto ET = reference<dim_magnetic_induction, exatesla>{};
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 unit_constants

View File

@ -22,7 +22,7 @@
#pragma once
#include <units/one_rep.h>
#include <units/reference.h>
#include <units/isq/dimensions/mass.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
@ -258,49 +258,49 @@ constexpr auto operator"" _q_Da(long double l) { return mass<dalton, long double
namespace unit_constants {
inline constexpr auto g = mass<gram, one_rep>{};
inline constexpr auto yg = mass<yoctogram, one_rep>{};
inline constexpr auto zg = mass<zeptogram, one_rep>{};
inline constexpr auto ag = mass<attogram, one_rep>{};
inline constexpr auto fg = mass<femtogram, one_rep>{};
inline constexpr auto pg = mass<picogram, one_rep>{};
inline constexpr auto ng = mass<nanogram, one_rep>{};
inline constexpr auto ug = mass<microgram, one_rep>{};
inline constexpr auto mg = mass<milligram, one_rep>{};
inline constexpr auto cg = mass<centigram, one_rep>{};
inline constexpr auto dg = mass<decigram, one_rep>{};
inline constexpr auto dag = mass<decagram, one_rep>{};
inline constexpr auto hg = mass<hectogram, one_rep>{};
inline constexpr auto kg = mass<kilogram, one_rep>{};
inline constexpr auto Mg = mass<megagram, one_rep>{};
inline constexpr auto Gg = mass<gigagram, one_rep>{};
inline constexpr auto Tg = mass<teragram, one_rep>{};
inline constexpr auto Pg = mass<petagram, one_rep>{};
inline constexpr auto Eg = mass<exagram, one_rep>{};
inline constexpr auto Zg = mass<zettagram, one_rep>{};
inline constexpr auto Yg = mass<yottagram, one_rep>{};
inline constexpr auto t = mass<tonne, one_rep>{};
inline constexpr auto yt = mass<yoctotonne, one_rep>{};
inline constexpr auto zt = mass<zeptotonne, one_rep>{};
inline constexpr auto at = mass<attotonne, one_rep>{};
inline constexpr auto ft = mass<femtotonne, one_rep>{};
inline constexpr auto pt = mass<picotonne, one_rep>{};
inline constexpr auto nt = mass<nanotonne, one_rep>{};
inline constexpr auto ut = mass<microtonne, one_rep>{};
inline constexpr auto mt = mass<millitonne, one_rep>{};
inline constexpr auto ct = mass<centitonne, one_rep>{};
inline constexpr auto dt = mass<decitonne, one_rep>{};
inline constexpr auto dat = mass<decatonne, one_rep>{};
inline constexpr auto ht = mass<hectotonne, one_rep>{};
inline constexpr auto kt = mass<kilotonne, one_rep>{};
inline constexpr auto Mt = mass<megatonne, one_rep>{};
inline constexpr auto Gt = mass<gigatonne, one_rep>{};
inline constexpr auto Tt = mass<teratonne, one_rep>{};
inline constexpr auto Pt = mass<petatonne, one_rep>{};
inline constexpr auto Et = mass<exatonne, one_rep>{};
inline constexpr auto Zt = mass<zettatonne, one_rep>{};
inline constexpr auto Yt = mass<yottatonne, one_rep>{};
inline constexpr auto Da = mass<dalton, one_rep>{};
inline constexpr auto g = reference<dim_mass, gram>{};
inline constexpr auto yg = reference<dim_mass, yoctogram>{};
inline constexpr auto zg = reference<dim_mass, zeptogram>{};
inline constexpr auto ag = reference<dim_mass, attogram>{};
inline constexpr auto fg = reference<dim_mass, femtogram>{};
inline constexpr auto pg = reference<dim_mass, picogram>{};
inline constexpr auto ng = reference<dim_mass, nanogram>{};
inline constexpr auto ug = reference<dim_mass, microgram>{};
inline constexpr auto mg = reference<dim_mass, milligram>{};
inline constexpr auto cg = reference<dim_mass, centigram>{};
inline constexpr auto dg = reference<dim_mass, decigram>{};
inline constexpr auto dag = reference<dim_mass, decagram>{};
inline constexpr auto hg = reference<dim_mass, hectogram>{};
inline constexpr auto kg = reference<dim_mass, kilogram>{};
inline constexpr auto Mg = reference<dim_mass, megagram>{};
inline constexpr auto Gg = reference<dim_mass, gigagram>{};
inline constexpr auto Tg = reference<dim_mass, teragram>{};
inline constexpr auto Pg = reference<dim_mass, petagram>{};
inline constexpr auto Eg = reference<dim_mass, exagram>{};
inline constexpr auto Zg = reference<dim_mass, zettagram>{};
inline constexpr auto Yg = reference<dim_mass, yottagram>{};
inline constexpr auto t = reference<dim_mass, tonne>{};
inline constexpr auto yt = reference<dim_mass, yoctotonne>{};
inline constexpr auto zt = reference<dim_mass, zeptotonne>{};
inline constexpr auto at = reference<dim_mass, attotonne>{};
inline constexpr auto ft = reference<dim_mass, femtotonne>{};
inline constexpr auto pt = reference<dim_mass, picotonne>{};
inline constexpr auto nt = reference<dim_mass, nanotonne>{};
inline constexpr auto ut = reference<dim_mass, microtonne>{};
inline constexpr auto mt = reference<dim_mass, millitonne>{};
inline constexpr auto ct = reference<dim_mass, centitonne>{};
inline constexpr auto dt = reference<dim_mass, decitonne>{};
inline constexpr auto dat = reference<dim_mass, decatonne>{};
inline constexpr auto ht = reference<dim_mass, hectotonne>{};
inline constexpr auto kt = reference<dim_mass, kilotonne>{};
inline constexpr auto Mt = reference<dim_mass, megatonne>{};
inline constexpr auto Gt = reference<dim_mass, gigatonne>{};
inline constexpr auto Tt = reference<dim_mass, teratonne>{};
inline constexpr auto Pt = reference<dim_mass, petatonne>{};
inline constexpr auto Et = reference<dim_mass, exatonne>{};
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 unit_constants

View File

@ -126,23 +126,23 @@ constexpr auto operator"" _q_YW(long double l) { return power<yottawatt, long do
namespace unit_constants {
inline constexpr auto W = power<watt, one_rep>{};
inline constexpr auto yW = power<yoctowatt, one_rep>{};
inline constexpr auto zW = power<zeptowatt, one_rep>{};
inline constexpr auto aW = power<attowatt, one_rep>{};
inline constexpr auto fW = power<femtowatt, one_rep>{};
inline constexpr auto pW = power<picowatt, one_rep>{};
inline constexpr auto nW = power<nanowatt, one_rep>{};
inline constexpr auto uW = power<microwatt, one_rep>{};
inline constexpr auto mW = power<milliwatt, one_rep>{};
inline constexpr auto kW = power<kilowatt, one_rep>{};
inline constexpr auto MW = power<megawatt, one_rep>{};
inline constexpr auto GW = power<gigawatt, one_rep>{};
inline constexpr auto TW = power<terawatt, one_rep>{};
inline constexpr auto PW = power<petawatt, one_rep>{};
inline constexpr auto EW = power<exawatt, one_rep>{};
inline constexpr auto ZW = power<zettawatt, one_rep>{};
inline constexpr auto YW = power<yottawatt, one_rep>{};
inline constexpr auto W = reference<dim_power, watt>{};
inline constexpr auto yW = reference<dim_power, yoctowatt>{};
inline constexpr auto zW = reference<dim_power, zeptowatt>{};
inline constexpr auto aW = reference<dim_power, attowatt>{};
inline constexpr auto fW = reference<dim_power, femtowatt>{};
inline constexpr auto pW = reference<dim_power, picowatt>{};
inline constexpr auto nW = reference<dim_power, nanowatt>{};
inline constexpr auto uW = reference<dim_power, microwatt>{};
inline constexpr auto mW = reference<dim_power, milliwatt>{};
inline constexpr auto kW = reference<dim_power, kilowatt>{};
inline constexpr auto MW = reference<dim_power, megawatt>{};
inline constexpr auto GW = reference<dim_power, gigawatt>{};
inline constexpr auto TW = reference<dim_power, terawatt>{};
inline constexpr auto PW = reference<dim_power, petawatt>{};
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 unit_constants

View File

@ -147,27 +147,27 @@ constexpr auto operator"" _q_YPa(long double l) { return pressure<yottapascal, l
namespace unit_constants {
inline constexpr auto Pa = pressure<pascal, one_rep>{};
inline constexpr auto yPa = pressure<yoctopascal, one_rep>{};
inline constexpr auto zPa = pressure<zeptopascal, one_rep>{};
inline constexpr auto aPa = pressure<attopascal, one_rep>{};
inline constexpr auto fPa = pressure<femtopascal, one_rep>{};
inline constexpr auto pPa = pressure<picopascal, one_rep>{};
inline constexpr auto nPa = pressure<nanopascal, one_rep>{};
inline constexpr auto uPa = pressure<micropascal, one_rep>{};
inline constexpr auto mPa = pressure<millipascal, one_rep>{};
inline constexpr auto cPa = pressure<centipascal, one_rep>{};
inline constexpr auto dPa = pressure<decipascal, one_rep>{};
inline constexpr auto daPa = pressure<decapascal, one_rep>{};
inline constexpr auto hPa = pressure<hectopascal, one_rep>{};
inline constexpr auto kPa = pressure<kilopascal, one_rep>{};
inline constexpr auto MPa = pressure<megapascal, one_rep>{};
inline constexpr auto GPa = pressure<gigapascal, one_rep>{};
inline constexpr auto TPa = pressure<terapascal, one_rep>{};
inline constexpr auto PPa = pressure<petapascal, one_rep>{};
inline constexpr auto EPa = pressure<exapascal, one_rep>{};
inline constexpr auto ZPa = pressure<zettapascal, one_rep>{};
inline constexpr auto YPa = pressure<yottapascal, one_rep>{};
inline constexpr auto Pa = reference<dim_pressure, pascal>{};
inline constexpr auto yPa = reference<dim_pressure, yoctopascal>{};
inline constexpr auto zPa = reference<dim_pressure, zeptopascal>{};
inline constexpr auto aPa = reference<dim_pressure, attopascal>{};
inline constexpr auto fPa = reference<dim_pressure, femtopascal>{};
inline constexpr auto pPa = reference<dim_pressure, picopascal>{};
inline constexpr auto nPa = reference<dim_pressure, nanopascal>{};
inline constexpr auto uPa = reference<dim_pressure, micropascal>{};
inline constexpr auto mPa = reference<dim_pressure, millipascal>{};
inline constexpr auto cPa = reference<dim_pressure, centipascal>{};
inline constexpr auto dPa = reference<dim_pressure, decipascal>{};
inline constexpr auto daPa = reference<dim_pressure, decapascal>{};
inline constexpr auto hPa = reference<dim_pressure, hectopascal>{};
inline constexpr auto kPa = reference<dim_pressure, kilopascal>{};
inline constexpr auto MPa = reference<dim_pressure, megapascal>{};
inline constexpr auto GPa = reference<dim_pressure, gigapascal>{};
inline constexpr auto TPa = reference<dim_pressure, terapascal>{};
inline constexpr auto PPa = reference<dim_pressure, petapascal>{};
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 unit_constants

View File

@ -145,27 +145,27 @@ constexpr auto operator"" _q_YBq(long double l) { return radioactivity<yottabecq
namespace unit_constants {
inline constexpr auto Bq = radioactivity<becquerel, one_rep>{};
inline constexpr auto yBq = radioactivity<yoctobecquerel, one_rep>{};
inline constexpr auto zBq = radioactivity<zeptobecquerel, one_rep>{};
inline constexpr auto aBq = radioactivity<attobecquerel, one_rep>{};
inline constexpr auto fBq = radioactivity<femtobecquerel, one_rep>{};
inline constexpr auto pBq = radioactivity<picobecquerel, one_rep>{};
inline constexpr auto nBq = radioactivity<nanobecquerel, one_rep>{};
inline constexpr auto uBq = radioactivity<microbecquerel, one_rep>{};
inline constexpr auto mBq = radioactivity<millibecquerel, one_rep>{};
inline constexpr auto cBq = radioactivity<centibecquerel, one_rep>{};
inline constexpr auto dBq = radioactivity<decibecquerel, one_rep>{};
inline constexpr auto daBq = radioactivity<decabecquerel, one_rep>{};
inline constexpr auto hBq = radioactivity<hectobecquerel, one_rep>{};
inline constexpr auto kBq = radioactivity<kilobecquerel, one_rep>{};
inline constexpr auto MBq = radioactivity<megabecquerel, one_rep>{};
inline constexpr auto GBq = radioactivity<gigabecquerel, one_rep>{};
inline constexpr auto TBq = radioactivity<terabecquerel, one_rep>{};
inline constexpr auto PBq = radioactivity<petabecquerel, one_rep>{};
inline constexpr auto EBq = radioactivity<exabecquerel, one_rep>{};
inline constexpr auto ZBq = radioactivity<zettabecquerel, one_rep>{};
inline constexpr auto YBq = radioactivity<yottabecquerel, one_rep>{};
inline constexpr auto Bq = reference<dim_radioactivity, becquerel>{};
inline constexpr auto yBq = reference<dim_radioactivity, yoctobecquerel>{};
inline constexpr auto zBq = reference<dim_radioactivity, zeptobecquerel>{};
inline constexpr auto aBq = reference<dim_radioactivity, attobecquerel>{};
inline constexpr auto fBq = reference<dim_radioactivity, femtobecquerel>{};
inline constexpr auto pBq = reference<dim_radioactivity, picobecquerel>{};
inline constexpr auto nBq = reference<dim_radioactivity, nanobecquerel>{};
inline constexpr auto uBq = reference<dim_radioactivity, microbecquerel>{};
inline constexpr auto mBq = reference<dim_radioactivity, millibecquerel>{};
inline constexpr auto cBq = reference<dim_radioactivity, centibecquerel>{};
inline constexpr auto dBq = reference<dim_radioactivity, decibecquerel>{};
inline constexpr auto daBq = reference<dim_radioactivity, decabecquerel>{};
inline constexpr auto hBq = reference<dim_radioactivity, hectobecquerel>{};
inline constexpr auto kBq = reference<dim_radioactivity, kilobecquerel>{};
inline constexpr auto MBq = reference<dim_radioactivity, megabecquerel>{};
inline constexpr auto GBq = reference<dim_radioactivity, gigabecquerel>{};
inline constexpr auto TBq = reference<dim_radioactivity, terabecquerel>{};
inline constexpr auto PBq = reference<dim_radioactivity, petabecquerel>{};
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 unit_constants

View File

@ -127,23 +127,23 @@ constexpr auto operator"" _q_YR(long double l) { return resistance<yottaohm, lon
namespace unit_constants {
inline constexpr auto R = resistance<ohm, one_rep>{};
inline constexpr auto yR = resistance<yoctoohm, one_rep>{};
inline constexpr auto zR = resistance<zeptoohm, one_rep>{};
inline constexpr auto aR = resistance<attoohm, one_rep>{};
inline constexpr auto fR = resistance<femtoohm, one_rep>{};
inline constexpr auto pR = resistance<picoohm, one_rep>{};
inline constexpr auto nR = resistance<nanoohm, one_rep>{};
inline constexpr auto uR = resistance<microohm, one_rep>{};
inline constexpr auto mR = resistance<milliohm, one_rep>{};
inline constexpr auto kR = resistance<kiloohm, one_rep>{};
inline constexpr auto MR = resistance<megaohm, one_rep>{};
inline constexpr auto GR = resistance<gigaohm, one_rep>{};
inline constexpr auto TR = resistance<teraohm, one_rep>{};
inline constexpr auto PR = resistance<petaohm, one_rep>{};
inline constexpr auto ER = resistance<exaohm, one_rep>{};
inline constexpr auto ZR = resistance<zettaohm, one_rep>{};
inline constexpr auto YR = resistance<yottaohm, one_rep>{};
inline constexpr auto R = reference<dim_resistance, ohm>{};
inline constexpr auto yR = reference<dim_resistance, yoctoohm>{};
inline constexpr auto zR = reference<dim_resistance, zeptoohm>{};
inline constexpr auto aR = reference<dim_resistance, attoohm>{};
inline constexpr auto fR = reference<dim_resistance, femtoohm>{};
inline constexpr auto pR = reference<dim_resistance, picoohm>{};
inline constexpr auto nR = reference<dim_resistance, nanoohm>{};
inline constexpr auto uR = reference<dim_resistance, microohm>{};
inline constexpr auto mR = reference<dim_resistance, milliohm>{};
inline constexpr auto kR = reference<dim_resistance, kiloohm>{};
inline constexpr auto MR = reference<dim_resistance, megaohm>{};
inline constexpr auto GR = reference<dim_resistance, gigaohm>{};
inline constexpr auto TR = reference<dim_resistance, teraohm>{};
inline constexpr auto PR = reference<dim_resistance, petaohm>{};
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 unit_constants

View File

@ -22,7 +22,7 @@
#pragma once
#include <units/one_rep.h>
#include <units/reference.h>
#include <units/isq/dimensions/thermodynamic_temperature.h>
#include <units/quantity.h>
@ -45,7 +45,7 @@ constexpr auto operator"" _q_K(long double l) { return thermodynamic_temperature
namespace unit_constants {
inline constexpr auto K = thermodynamic_temperature<kelvin, one_rep>{};
inline constexpr auto K = reference<dim_thermodynamic_temperature, kelvin>{};
} // namespace unit_constants

View File

@ -22,7 +22,7 @@
#pragma once
#include <units/one_rep.h>
#include <units/reference.h>
#include <units/isq/dimensions/time.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
@ -101,18 +101,18 @@ constexpr auto operator"" _q_d(long double l) { return time<day, long double>(l)
namespace unit_constants {
inline constexpr auto ys = time<yoctosecond, one_rep>{};
inline constexpr auto zs = time<zeptosecond, one_rep>{};
inline constexpr auto as = time<attosecond, one_rep>{};
inline constexpr auto fs = time<femtosecond, one_rep>{};
inline constexpr auto ps = time<picosecond, one_rep>{};
inline constexpr auto ns = time<nanosecond, one_rep>{};
inline constexpr auto us = time<microsecond, one_rep>{};
inline constexpr auto ms = time<millisecond, one_rep>{};
inline constexpr auto s = time<second, one_rep>{};
inline constexpr auto min = time<minute, one_rep>{};
inline constexpr auto h = time<hour, one_rep>{};
inline constexpr auto d = time<day, one_rep>{};
inline constexpr auto ys = reference<dim_time, yoctosecond>{};
inline constexpr auto zs = reference<dim_time, zeptosecond>{};
inline constexpr auto as = reference<dim_time, attosecond>{};
inline constexpr auto fs = reference<dim_time, femtosecond>{};
inline constexpr auto ps = reference<dim_time, picosecond>{};
inline constexpr auto ns = reference<dim_time, nanosecond>{};
inline constexpr auto us = reference<dim_time, microsecond>{};
inline constexpr auto ms = reference<dim_time, millisecond>{};
inline constexpr auto s = reference<dim_time, second>{};
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 unit_constants

View File

@ -47,7 +47,7 @@ constexpr auto operator"" _q_Nm_per_rad(long double l) { return torque<newton_me
namespace unit_constants {
inline constexpr auto Nm_per_rad = torque<newton_metre_per_radian, one_rep>{};
inline constexpr auto Nm_per_rad = reference<dim_torque, newton_metre_per_radian>{};
} // namespace unit_constants

View File

@ -147,27 +147,27 @@ constexpr auto operator"" _q_YV(long double l) { return voltage<yottavolt, long
namespace unit_constants {
inline constexpr auto V = voltage<volt, one_rep>{};
inline constexpr auto yV = voltage<yoctovolt, one_rep>{};
inline constexpr auto zV = voltage<zeptovolt, one_rep>{};
inline constexpr auto aV = voltage<attovolt, one_rep>{};
inline constexpr auto fV = voltage<femtovolt, one_rep>{};
inline constexpr auto pV = voltage<picovolt, one_rep>{};
inline constexpr auto nV = voltage<nanovolt, one_rep>{};
inline constexpr auto uV = voltage<microvolt, one_rep>{};
inline constexpr auto mV = voltage<millivolt, one_rep>{};
inline constexpr auto cV = voltage<centivolt, one_rep>{};
inline constexpr auto dV = voltage<decivolt, one_rep>{};
inline constexpr auto daV = voltage<decavolt, one_rep>{};
inline constexpr auto hV = voltage<hectovolt, one_rep>{};
inline constexpr auto kV = voltage<kilovolt, one_rep>{};
inline constexpr auto MV = voltage<megavolt, one_rep>{};
inline constexpr auto GV = voltage<gigavolt, one_rep>{};
inline constexpr auto TV = voltage<teravolt, one_rep>{};
inline constexpr auto PV = voltage<petavolt, one_rep>{};
inline constexpr auto EV = voltage<exavolt, one_rep>{};
inline constexpr auto ZV = voltage<zettavolt, one_rep>{};
inline constexpr auto YV = voltage<yottavolt, one_rep>{};
inline constexpr auto V = reference<dim_voltage, volt>{};
inline constexpr auto yV = reference<dim_voltage, yoctovolt>{};
inline constexpr auto zV = reference<dim_voltage, zeptovolt>{};
inline constexpr auto aV = reference<dim_voltage, attovolt>{};
inline constexpr auto fV = reference<dim_voltage, femtovolt>{};
inline constexpr auto pV = reference<dim_voltage, picovolt>{};
inline constexpr auto nV = reference<dim_voltage, nanovolt>{};
inline constexpr auto uV = reference<dim_voltage, microvolt>{};
inline constexpr auto mV = reference<dim_voltage, millivolt>{};
inline constexpr auto cV = reference<dim_voltage, centivolt>{};
inline constexpr auto dV = reference<dim_voltage, decivolt>{};
inline constexpr auto daV = reference<dim_voltage, decavolt>{};
inline constexpr auto hV = reference<dim_voltage, hectovolt>{};
inline constexpr auto kV = reference<dim_voltage, kilovolt>{};
inline constexpr auto MV = reference<dim_voltage, megavolt>{};
inline constexpr auto GV = reference<dim_voltage, gigavolt>{};
inline constexpr auto TV = reference<dim_voltage, teravolt>{};
inline constexpr auto PV = reference<dim_voltage, petavolt>{};
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 unit_constants

View File

@ -251,48 +251,48 @@ constexpr auto operator"" _q_Yl(long double l) { return volume<yottalitre, long
namespace unit_constants {
inline constexpr auto m3 = volume<cubic_metre, one_rep>{};
inline constexpr auto ym3 = volume<cubic_yoctometre, one_rep>{};
inline constexpr auto zm3 = volume<cubic_zeptometre, one_rep>{};
inline constexpr auto am3 = volume<cubic_attometre, one_rep>{};
inline constexpr auto fm3 = volume<cubic_femtometre, one_rep>{};
inline constexpr auto pm3 = volume<cubic_picometre, one_rep>{};
inline constexpr auto nm3 = volume<cubic_nanometre, one_rep>{};
inline constexpr auto um3 = volume<cubic_micrometre, one_rep>{};
inline constexpr auto mm3 = volume<cubic_millimetre, one_rep>{};
inline constexpr auto cm3 = volume<cubic_centimetre, one_rep>{};
inline constexpr auto dm3 = volume<cubic_decimetre, one_rep>{};
inline constexpr auto dam3 = volume<cubic_decametre, one_rep>{};
inline constexpr auto hm3 = volume<cubic_hectometre, one_rep>{};
inline constexpr auto km3 = volume<cubic_kilometre, one_rep>{};
inline constexpr auto Mm3 = volume<cubic_megametre, one_rep>{};
inline constexpr auto Gm3 = volume<cubic_gigametre, one_rep>{};
inline constexpr auto Tm3 = volume<cubic_terametre, one_rep>{};
inline constexpr auto Pm3 = volume<cubic_petametre, one_rep>{};
inline constexpr auto Em3 = volume<cubic_exametre, one_rep>{};
inline constexpr auto Zm3 = volume<cubic_zettametre, one_rep>{};
inline constexpr auto Ym3 = volume<cubic_yottametre, one_rep>{};
inline constexpr auto l = volume<litre, one_rep>{};
inline constexpr auto yl = volume<yoctolitre, one_rep>{};
inline constexpr auto zl = volume<zeptolitre, one_rep>{};
inline constexpr auto al = volume<attolitre, one_rep>{};
inline constexpr auto fl = volume<femtolitre, one_rep>{};
inline constexpr auto pl = volume<picolitre, one_rep>{};
inline constexpr auto nl = volume<nanolitre, one_rep>{};
inline constexpr auto ul = volume<microlitre, one_rep>{};
inline constexpr auto ml = volume<millilitre, one_rep>{};
inline constexpr auto cl = volume<centilitre, one_rep>{};
inline constexpr auto dl = volume<decilitre, one_rep>{};
inline constexpr auto dal = volume<decalitre, one_rep>{};
inline constexpr auto hl = volume<hectolitre, one_rep>{};
inline constexpr auto kl = volume<kilolitre, one_rep>{};
inline constexpr auto Ml = volume<megalitre, one_rep>{};
inline constexpr auto Gl = volume<gigalitre, one_rep>{};
inline constexpr auto Tl = volume<teralitre, one_rep>{};
inline constexpr auto Pl = volume<petalitre, one_rep>{};
inline constexpr auto El = volume<exalitre, one_rep>{};
inline constexpr auto Zl = volume<zettalitre, one_rep>{};
inline constexpr auto Yl = volume<yottalitre, one_rep>{};
inline constexpr auto m3 = reference<dim_volume, cubic_metre>{};
inline constexpr auto ym3 = reference<dim_volume, cubic_yoctometre>{};
inline constexpr auto zm3 = reference<dim_volume, cubic_zeptometre>{};
inline constexpr auto am3 = reference<dim_volume, cubic_attometre>{};
inline constexpr auto fm3 = reference<dim_volume, cubic_femtometre>{};
inline constexpr auto pm3 = reference<dim_volume, cubic_picometre>{};
inline constexpr auto nm3 = reference<dim_volume, cubic_nanometre>{};
inline constexpr auto um3 = reference<dim_volume, cubic_micrometre>{};
inline constexpr auto mm3 = reference<dim_volume, cubic_millimetre>{};
inline constexpr auto cm3 = reference<dim_volume, cubic_centimetre>{};
inline constexpr auto dm3 = reference<dim_volume, cubic_decimetre>{};
inline constexpr auto dam3 = reference<dim_volume, cubic_decametre>{};
inline constexpr auto hm3 = reference<dim_volume, cubic_hectometre>{};
inline constexpr auto km3 = reference<dim_volume, cubic_kilometre>{};
inline constexpr auto Mm3 = reference<dim_volume, cubic_megametre>{};
inline constexpr auto Gm3 = reference<dim_volume, cubic_gigametre>{};
inline constexpr auto Tm3 = reference<dim_volume, cubic_terametre>{};
inline constexpr auto Pm3 = reference<dim_volume, cubic_petametre>{};
inline constexpr auto Em3 = reference<dim_volume, cubic_exametre>{};
inline constexpr auto Zm3 = reference<dim_volume, cubic_zettametre>{};
inline constexpr auto Ym3 = reference<dim_volume, cubic_yottametre>{};
inline constexpr auto l = reference<dim_volume, litre>{};
inline constexpr auto yl = reference<dim_volume, yoctolitre>{};
inline constexpr auto zl = reference<dim_volume, zeptolitre>{};
inline constexpr auto al = reference<dim_volume, attolitre>{};
inline constexpr auto fl = reference<dim_volume, femtolitre>{};
inline constexpr auto pl = reference<dim_volume, picolitre>{};
inline constexpr auto nl = reference<dim_volume, nanolitre>{};
inline constexpr auto ul = reference<dim_volume, microlitre>{};
inline constexpr auto ml = reference<dim_volume, millilitre>{};
inline constexpr auto cl = reference<dim_volume, centilitre>{};
inline constexpr auto dl = reference<dim_volume, decilitre>{};
inline constexpr auto dal = reference<dim_volume, decalitre>{};
inline constexpr auto hl = reference<dim_volume, hectolitre>{};
inline constexpr auto kl = reference<dim_volume, kilolitre>{};
inline constexpr auto Ml = reference<dim_volume, megalitre>{};
inline constexpr auto Gl = reference<dim_volume, gigalitre>{};
inline constexpr auto Tl = reference<dim_volume, teralitre>{};
inline constexpr auto Pl = reference<dim_volume, petalitre>{};
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 unit_constants

View File

@ -434,6 +434,11 @@ concept invalid_compound_assignments = requires(quantity_kind<Width, metre, int>
requires !requires { w *= 1 * km / m; };
requires !requires { w /= 1 * km / m; };
requires !requires { w %= 1 * km / m; };
requires !requires { w += m; };
requires !requires { w -= m; };
requires !requires { w *= m; };
requires !requires { w /= m; };
requires !requires { w %= m; };
requires !requires { w *= quantity_kind<downcast_kind<Width, dim_one>, scaled_unit<ratio{1, 1, 3}, one>, int>{1}; };
requires !requires { w /= quantity_kind<downcast_kind<Width, dim_one>, scaled_unit<ratio{1, 1, 3}, one>, int>{1}; };
requires !requires { w %= quantity_kind<downcast_kind<Width, dim_one>, scaled_unit<ratio{1, 1, 3}, one>, int>{1}; };
@ -478,10 +483,12 @@ static_assert(!std::is_invocable_v<std::plus<>, width<metre>, double>);
static_assert(!std::is_invocable_v<std::plus<>, width<metre>, length<metre>>);
static_assert(!std::is_invocable_v<std::plus<>, width<metre>, quantity_point<dim_length, metre>>);
static_assert(!std::is_invocable_v<std::plus<>, width<metre>, height<metre>>);
static_assert(!std::is_invocable_v<std::plus<>, width<metre>, reference<dim_length, metre>>);
static_assert(!std::is_invocable_v<std::minus<>, width<metre>, double>);
static_assert(!std::is_invocable_v<std::minus<>, width<metre>, length<metre>>);
static_assert(!std::is_invocable_v<std::minus<>, width<metre>, quantity_point<dim_length, metre>>);
static_assert(!std::is_invocable_v<std::minus<>, width<metre>, height<metre>>);
static_assert(!std::is_invocable_v<std::minus<>, width<metre>, reference<dim_length, metre>>);
// clang-format off
static_assert(!std::is_invocable_v<std::plus<>, quantity_kind<downcast_kind<width_kind, dim_one>, one>, quantity_kind<downcast_kind<height_kind, dim_one>, one>>);
@ -541,6 +548,7 @@ static_assert(same(apples<one, int>(2) * quantity(2), apples<one, int>(4)));
static_assert(same(quantity(2) * apples<one, int>(2), apples<one, int>(4)));
// clang-format off
static_assert(same(width<metre, int>(4 * m) * m, horizontal_area<square_metre, int>(4 * m * m)));
static_assert(same(width<metre, int>(2 * m) * width<metre, int>(2 * m), horizontal_area<square_metre, int>(4 * m * m)));
static_assert(same(width<metre, int>(2 * m) * width<metre, double>(2 * m), horizontal_area<square_metre, double>(4 * m * m)));
static_assert(same(width<metre, double>(2 * m) * width<metre, int>(2 * m), horizontal_area<square_metre, double>(4 * m * m)));
@ -549,6 +557,7 @@ static_assert(same(width<metre, double>(2 * m) * width<metre, int>(2 * m), horiz
static_assert(same(apples<one, int>(2) * apples<one, int>(2), apples<one, int>(4)));
static_assert(same(apples<one, int>(2) * (2 / apples<one, int>(1)), apples<one, int>(4)));
static_assert(same(width<kilometre>(4 * m) * mm, horizontal_area<square_metre>(4 * m * mm)));
static_assert(same(width<kilometre>(2 * m) * width<millimetre>(2 * m), horizontal_area<square_metre>(4 * m * m)));
static_assert(same(width<metre>(2 * m) * (1 / width<metre>(2 * m)),
quantity_kind<downcast_kind<width_kind, dim_one>, one>(1)));
@ -626,6 +635,7 @@ static_assert(same(apples<one, int>(8) / apples<one, int>(2), apples<one, int>(4
static_assert(same(apples<one, int>(8) / (2 / apples<one, int>(1)), apples<one, int>(4)));
static_assert(same(horizontal_area<square_metre>(8 * m * m) / width<metre>(2 * m), width<metre>(4 * m)));
static_assert(same(horizontal_area<square_metre>(4 * m * m) / m, width<metre>(4 * m)));
static_assert(same(width<metre, int>(2 * m) % 3, width<metre, int>(2 * m)));
static_assert(same(width<metre, int>(3 * m) % width<metre, int>(2 * m), width<metre, int>(1 * m)));
@ -634,14 +644,17 @@ static_assert(is_same_v<
decltype((width<metre, std::uint8_t>(0 * m) % width<metre, std::uint8_t>(0 * m)).common().count()),
decltype(std::uint8_t(0) % std::uint8_t(0))>);
static_assert(!std::is_invocable_v<std::multiplies<>, reference<dim_length, metre>, width<metre>>);
static_assert(!std::is_invocable_v<std::multiplies<>, width<metre>, height<metre>>);
static_assert(!std::is_invocable_v<std::multiplies<>, height<metre>, quantity_point<dim_length, metre>>);
static_assert(!std::is_invocable_v<std::multiplies<>, quantity_point<dim_length, metre>, height<metre>>);
static_assert(!std::is_invocable_v<std::divides<>, reference<dim_length, metre>, width<metre>>);
static_assert(!std::is_invocable_v<std::divides<>, width<metre>, height<metre>>);
static_assert(!std::is_invocable_v<std::divides<>, height<metre>, quantity_point<dim_length, metre>>);
static_assert(!std::is_invocable_v<std::divides<>, quantity_point<dim_length, metre>, height<metre>>);
static_assert(!std::is_invocable_v<std::modulus<>, width<metre, int>, reference<dim_length, metre>>);
static_assert(!std::is_invocable_v<std::modulus<>, width<metre, int>, length<metre, int>>);
static_assert(!std::is_invocable_v<std::modulus<>, width<metre, int>, quantity_point<dim_length, metre, int>>);
static_assert(!std::is_invocable_v<std::modulus<>, width<metre, int>, double>);
@ -690,6 +703,8 @@ concept invalid_equality = requires(quantity_kind<Width, metre, int> w) {
requires !requires { w == 1 * m; };
requires !requires { w != 1.0 * cgs_cm; };
requires !requires { w == 1 * km; };
requires !requires { w != m; };
requires !requires { w == km; };
requires !requires { w != quantity(1); };
requires !requires { w == dimensionless<percent>(1.0); };
requires !requires { w != height<metre, int>(1 * m); };
@ -770,7 +785,6 @@ static_assert(same(quantity_kind_cast<length<centimetre, int>>(width<cgs::centim
// clang-format on
template<typename Width>
concept invalid_cast = requires {
requires !requires { quantity_kind_cast<width<metre, one_rep>>(quantity_kind<Width, metre, int>(1 * m)); };
requires !requires { quantity_kind_cast<apples<one, int>>(quantity_kind<Width, metre, int>(1 * m)); };
requires !requires { quantity_kind_cast<horizontal_area<square_metre, int>>(quantity_kind<Width, metre, int>(1 * m)); };
requires !requires { quantity_kind_cast<rate_of_climb<metre_per_second, int>>(quantity_kind<Width, metre, int>(1 * m)); };
@ -783,7 +797,6 @@ concept invalid_cast = requires {
requires !requires { quantity_kind_cast<dimensionless<one>>(quantity_kind<Width, metre, int>(1 * m)); };
requires !requires { quantity_kind_cast<square_metre>(quantity_kind<Width, metre, int>(1 * m)); };
requires !requires { quantity_kind_cast<second>(quantity_kind<Width, metre, int>(1 * m)); };
requires !requires { quantity_kind_cast<one_rep>(quantity_kind<Width, metre, int>(1 * m)); };
requires !requires { quantity_kind_cast<quantity_point<dim_length, metre, int>>(quantity_kind<Width, metre, int>(1 * m)); };
requires !requires { quantity_kind_cast<quantity_point<dim_one, one, int>>(quantity_kind<Width, metre, int>(1 * m)); };
};

View File

@ -220,9 +220,6 @@ static_assert(construct_from_only<nth_apple<one, double>>(1).relative().common()
static_assert(construct_from_only<nth_apple<one, double>>(short{1}).relative().common() == 1);
static_assert(construct_from_only<nth_apple<one, short>>(1).relative().common() == 1);
static_assert(construct_from_only<nth_apple<one, int>>(1).relative().common() == 1);
static_assert(construct_from_only<nth_apple<one, double>>(one_rep{}).relative().common() == 1);
static_assert(construct_from_only<nth_apple<one, int>>(one_rep{}).relative().common() == 1);
static_assert(construct_from_only<nth_apple<one, short>>(one_rep{}).relative().common() == 1);
static_assert(construct_from_only<nth_apple<percent, int>>(1ULL).relative().common().count() == 1);
static_assert(construct_from_only<nth_apple<percent, double>>(1).relative().common().count() == 1);
static_assert(!constructible_or_convertible_from<nth_apple<percent, int>>(1.0));
@ -605,7 +602,6 @@ static_assert(same(quantity_point_kind_cast<length<centimetre, int>>(abscissa<cg
// clang-format on
template<typename Int>
concept invalid_cast = requires(Int i) {
requires !requires { quantity_point_kind_cast<abscissa<metre, one_rep>>(abscissa<metre, Int>(i * m)); };
requires !requires { quantity_point_kind_cast<apples<one, Int>>(abscissa<metre, Int>(i * m)); };
requires !requires { quantity_point_kind_cast<rate_of_climb<metre_per_second, Int>>(abscissa<metre, Int>(i * m)); };
requires !requires { quantity_point_kind_cast<apple>(abscissa<metre, Int>(i * m)); };
@ -620,7 +616,6 @@ concept invalid_cast = requires(Int i) {
requires !requires { quantity_point_kind_cast<dimensionless<one>>(abscissa<metre, Int>(i * m)); };
requires !requires { quantity_point_kind_cast<square_metre>(abscissa<metre, Int>(i * m)); };
requires !requires { quantity_point_kind_cast<second>(abscissa<metre, Int>(i * m)); };
requires !requires { quantity_point_kind_cast<one_rep>(abscissa<metre, Int>(i * m)); };
requires !requires { quantity_point_kind_cast<quantity_point<dim_length, metre, Int>>(abscissa<metre, Int>(i * m)); };
requires !requires { quantity_point_kind_cast<quantity_point<dim_one, one, Int>>(abscissa<metre, Int>(i * m)); };
};

View File

@ -342,6 +342,13 @@ concept invalid_compound_assignments = requires() {
requires !requires(length<Metre, double> l) { l %= 2._q_m; };
requires !requires(length<Metre, double> l) { l %= 2_q_m; };
requires !requires(length<Metre, int> l) { l %= 2._q_m; };
// no unit constants
requires !requires(length<Metre, int> l) { l += m; };
requires !requires(length<Metre, int> l) { l -= m; };
requires !requires(length<Metre, int> l) { l *= m; };
requires !requires(length<Metre, int> l) { l /= m; };
requires !requires(length<Metre, int> l) { l %= m; };
};
static_assert(invalid_compound_assignments<metre, kilometre>);
@ -363,6 +370,14 @@ concept invalid_binary_operations = requires {
requires !requires(length<Metre, double> a, length<Metre, double> b) { a % b; };
requires !requires(length<Metre, double> a, length<Metre, int> b) { a % b; };
requires !requires(length<Metre, double> a, length<Metre, int> b) { b % a; };
// unit constants
requires !requires { length<Metre, int>(1) + m; };
requires !requires { length<Metre, int>(1) - m; };
requires !requires { length<Metre, int>(1) % m; };
requires !requires { m + length<Metre, int>(1); };
requires !requires { m - length<Metre, int>(1); };
requires !requires { m % length<Metre, int>(1); };
};
static_assert(invalid_binary_operations<metre>);
@ -542,6 +557,11 @@ static_assert(quantity_cast<one>(10_q_km / 5_q_m).count() == 2000);
static_assert((10_q_s * 2_q_kHz).count() == 20);
// unit constants
static_assert(2_q_m * m == (2_q_m2));
static_assert(2_q_m2 / m == (2_q_m));
// dimensionless
@ -581,6 +601,9 @@ static_assert((quantity{std::uint8_t(0)} - quantity{std::uint8_t(1)}).count() ==
static_assert(is_same_v<decltype((quantity{std::uint8_t(0)} % quantity{std::uint8_t(0)}).count()),
decltype(std::uint8_t(0) % std::uint8_t(0))>);
static_assert(quantity{2} * m == 2_q_m);
static_assert(quantity{2} / m == 2 / 1_q_m);
///////////////////////
// equality operators

View File

@ -60,14 +60,15 @@ concept invalid_operations = requires {
};
static_assert(invalid_operations<s>);
constexpr auto m_per_s = m / s;
static_assert(2_q_m / s == 2_q_m_per_s);
static_assert(2 * m / s == 2_q_m_per_s);
static_assert(2 / s * m == 2_q_m_per_s);
static_assert(2 * (m / s) == 2_q_m_per_s);
#if !(UNITS_COMP_GCC == 10 && UNITS_COMP_GCC_MINOR == 1)
constexpr auto m_per_s = m / s;
static_assert(2 * ::m_per_s == 2_q_m_per_s);
static_assert(is_same_v<decltype(::m_per_s)::rep, decltype(m)::rep>);
#endif
static_assert(120 * km / (2 * h) == 60_q_km_per_h);
static_assert(120 * km / 2 / h == 60_q_km_per_h);
@ -82,14 +83,17 @@ static_assert(is_same_v<decltype(120.L * km / 2 / h), decltype(60._q_km_per_h)>)
static_assert(1. / 4 * m2 == 1._q_m2 / 4);
#if !defined(UNITS_COMP_CLANG) // -Wshadow
static_assert([] {
UNITS_DIAGNOSTIC_PUSH
UNITS_DIAGNOSTIC_IGNORE_SHADOW
constexpr bool test_hiding() {
Speed auto v0 = 10 * m / s;
signed s = 2; // hides ^
Length auto v = 20 * m / s;
/* */ v0 = 10 * m / ::s;
return !is_same_v<decltype(v0), decltype(v)>;
}());
#endif
}
static_assert(test_hiding());
UNITS_DIAGNOSTIC_POP
int main() {}