build: core library and each system separated to dedicated CMake targets

Refers to #249
This commit is contained in:
Mateusz Pusz committed 2021-03-16 23:05:45 +01:00
1 parent 7ee0e3ff90
commit 221883bb25
206 files changed
+547 -121

No files matched your search

@@ -0,0 +1,173 @@
// 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/isq/dimensions/absorbed_dose.h>
#include <units/isq/si/energy.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct gray : named_unit<gray, "Gy", prefix> {};
struct yoctogray : prefixed_unit<yoctogray, yocto, gray> {};
struct zeptogray : prefixed_unit<zeptogray, zepto, gray> {};
struct attogray : prefixed_unit<attogray, atto, gray> {};
struct femtogray : prefixed_unit<femtogray, femto, gray> {};
struct picogray : prefixed_unit<picogray, pico, gray> {};
struct nanogray : prefixed_unit<nanogray, nano, gray> {};
struct microgray : prefixed_unit<microgray, micro, gray> {};
struct milligray : prefixed_unit<milligray, milli, gray> {};
struct centigray : prefixed_unit<centigray, centi, gray> {};
struct decigray : prefixed_unit<decigray, deci, gray> {};
struct decagray : prefixed_unit<decagray, deca, gray> {};
struct hectogray : prefixed_unit<hectogray, hecto, gray> {};
struct kilogray : prefixed_unit<kilogray, kilo, gray> {};
struct megagray : prefixed_unit<megagray, mega, gray> {};
struct gigagray : prefixed_unit<gigagray, giga, gray> {};
struct teragray : prefixed_unit<teragray, tera, gray> {};
struct petagray : prefixed_unit<petagray, peta, gray> {};
struct exagray : prefixed_unit<exagray, exa, gray> {};
struct zettagray : prefixed_unit<zettagray, zetta, gray> {};
struct yottagray : prefixed_unit<yottagray, yotta, gray> {};
struct dim_absorbed_dose : isq::dim_absorbed_dose<dim_absorbed_dose, gray, dim_energy, dim_mass> {};
template<UnitOf<dim_absorbed_dose> U, QuantityValue Rep = double>
using absorbed_dose = quantity<dim_absorbed_dose, U, Rep>;
inline namespace literals {
// Gy
constexpr auto operator"" _q_Gy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<gray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Gy(long double l) { return absorbed_dose<gray, long double>(l); }
// yGy
constexpr auto operator"" _q_yGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<yoctogray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yGy(long double l) { return absorbed_dose<yoctogray, long double>(l); }
// zGy
constexpr auto operator"" _q_zGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<zeptogray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zGy(long double l) { return absorbed_dose<zeptogray, long double>(l); }
// aGy
constexpr auto operator"" _q_aGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<attogray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aGy(long double l) { return absorbed_dose<attogray, long double>(l); }
// fGy
constexpr auto operator"" _q_fGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<femtogray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fGy(long double l) { return absorbed_dose<femtogray, long double>(l); }
// pGy
constexpr auto operator"" _q_pGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<picogray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pGy(long double l) { return absorbed_dose<picogray, long double>(l); }
// nGy
constexpr auto operator"" _q_nGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<nanogray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nGy(long double l) { return absorbed_dose<nanogray, long double>(l); }
// uGy
constexpr auto operator"" _q_uGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<microgray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uGy(long double l) { return absorbed_dose<microgray, long double>(l); }
// mGy
constexpr auto operator"" _q_mGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<milligray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mGy(long double l) { return absorbed_dose<milligray, long double>(l); }
// cGy
constexpr auto operator"" _q_cGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<centigray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cGy(long double l) { return absorbed_dose<centigray, long double>(l); }
// dGy
constexpr auto operator"" _q_dGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<decigray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dGy(long double l) { return absorbed_dose<decigray, long double>(l); }
// daGy
constexpr auto operator"" _q_daGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<decagray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_daGy(long double l) { return absorbed_dose<decagray, long double>(l); }
// hGy
constexpr auto operator"" _q_hGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<hectogray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hGy(long double l) { return absorbed_dose<hectogray, long double>(l); }
// kGy
constexpr auto operator"" _q_kGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<kilogray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kGy(long double l) { return absorbed_dose<kilogray, long double>(l); }
// MGy
constexpr auto operator"" _q_MGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<megagray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MGy(long double l) { return absorbed_dose<megagray, long double>(l); }
// GGy
constexpr auto operator"" _q_GGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<gigagray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GGy(long double l) { return absorbed_dose<gigagray, long double>(l); }
// TGy
constexpr auto operator"" _q_TGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<teragray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TGy(long double l) { return absorbed_dose<teragray, long double>(l); }
// PGy
constexpr auto operator"" _q_PGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<petagray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PGy(long double l) { return absorbed_dose<petagray, long double>(l); }
// EGy
constexpr auto operator"" _q_EGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<exagray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EGy(long double l) { return absorbed_dose<exagray, long double>(l); }
// ZGy
constexpr auto operator"" _q_ZGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<zettagray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZGy(long double l) { return absorbed_dose<zettagray, long double>(l); }
// YGy
constexpr auto operator"" _q_YGy(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return absorbed_dose<yottagray, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YGy(long double l) { return absorbed_dose<yottagray, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,45 @@
// 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/isq/dimensions/acceleration.h>
#include <units/isq/si/speed.h>
#include <units/quantity.h>
namespace units::isq::si {
struct metre_per_second_sq : unit<metre_per_second_sq> {};
struct dim_acceleration : isq::dim_acceleration<dim_acceleration, metre_per_second_sq, dim_length, dim_time> {};
template<UnitOf<dim_acceleration> U, QuantityValue Rep = double>
using acceleration = quantity<dim_acceleration, U, Rep>;
inline namespace literals {
// m/s2
constexpr auto operator"" _q_m_per_s2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return acceleration<metre_per_second_sq, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_m_per_s2(long double l) { return acceleration<metre_per_second_sq, long double>(l); }
} // namespace literals
} // namespace units::isq::si
@@ -0,0 +1,53 @@
// 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/one_rep.h>
#include <units/isq/dimensions/amount_of_substance.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct mole : named_unit<mole, "mol", prefix> {};
struct dim_amount_of_substance : isq::dim_amount_of_substance<mole> {};
template<UnitOf<dim_amount_of_substance> U, QuantityValue Rep = double>
using amount_of_substance = quantity<dim_amount_of_substance, U, Rep>;
inline namespace literals {
// mol
constexpr auto operator"" _q_mol(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return amount_of_substance<mole, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mol(long double l) { return amount_of_substance<mole, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto mol = amount_of_substance<mole, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,48 @@
// 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/isq/dimensions/angular_velocity.h>
#include <units/generic/angle.h>
#include <units/isq/si/time.h>
#include <units/quantity.h>
namespace units::isq::si {
struct radian_per_second : named_unit<radian_per_second, basic_symbol_text{"ω", "w"}, no_prefix> {};
struct dim_angular_velocity : isq::dim_angular_velocity<dim_angular_velocity, radian_per_second, dim_angle<>, dim_time> {};
template<UnitOf<dim_angular_velocity> U, QuantityValue Rep = double>
using angular_velocity = quantity<dim_angular_velocity, U, Rep>;
inline namespace literals {
// rad / s
constexpr auto operator"" _q_rad_per_s(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return angular_velocity<radian_per_second, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_rad_per_s(long double l) { return angular_velocity<radian_per_second, long double>(l); }
} // namespace literals
} // namespace units::isq::si
+179
View File
@@ -0,0 +1,179 @@
// 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/isq/dimensions/area.h>
#include <units/isq/si/length.h>
#include <units/quantity.h>
namespace units::isq::si {
struct square_metre : unit<square_metre> {};
struct dim_area : isq::dim_area<dim_area, square_metre, dim_length> {};
struct square_yoctometre : deduced_unit<square_yoctometre, dim_area, yoctometre> {};
struct square_zeptometre : deduced_unit<square_zeptometre, dim_area, zeptometre> {};
struct square_attometre : deduced_unit<square_attometre, dim_area, attometre> {};
struct square_femtometre : deduced_unit<square_femtometre, dim_area, femtometre> {};
struct square_picometre : deduced_unit<square_picometre, dim_area, picometre> {};
struct square_nanometre : deduced_unit<square_nanometre, dim_area, nanometre> {};
struct square_micrometre : deduced_unit<square_micrometre, dim_area, micrometre> {};
struct square_millimetre : deduced_unit<square_millimetre, dim_area, millimetre> {};
struct square_centimetre : deduced_unit<square_centimetre, dim_area, centimetre> {};
struct square_decimetre : deduced_unit<square_decimetre, dim_area, decimetre> {};
struct square_decametre : deduced_unit<square_decametre, dim_area, decametre> {};
struct square_hectometre : deduced_unit<square_hectometre, dim_area, hectometre> {};
struct square_kilometre : deduced_unit<square_kilometre, dim_area, kilometre> {};
struct square_megametre : deduced_unit<square_megametre, dim_area, megametre> {};
struct square_gigametre : deduced_unit<square_gigametre, dim_area, gigametre> {};
struct square_terametre : deduced_unit<square_terametre, dim_area, terametre> {};
struct square_petametre : deduced_unit<square_petametre, dim_area, petametre> {};
struct square_exametre : deduced_unit<square_exametre, dim_area, exametre> {};
struct square_zettametre : deduced_unit<square_zettametre, dim_area, zettametre> {};
struct square_yottametre : deduced_unit<square_yottametre, dim_area, yottametre> {};
struct hectare : alias_unit<square_hectometre, "ha", no_prefix> {};
template<UnitOf<dim_area> U, QuantityValue Rep = double>
using area = quantity<dim_area, U, Rep>;
inline namespace literals {
// m2
constexpr auto operator"" _q_m2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_metre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_m2(long double l) { return area<square_metre, long double>(l); }
// ym2
constexpr auto operator"" _q_ym2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_yoctometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ym2(long double l) { return area<square_yoctometre, long double>(l); }
// zm2
constexpr auto operator"" _q_zm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_zeptometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zm2(long double l) { return area<square_zeptometre, long double>(l); }
// am2
constexpr auto operator"" _q_am2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_attometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_am2(long double l) { return area<square_attometre, long double>(l); }
// fm2
constexpr auto operator"" _q_fm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_femtometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fm2(long double l) { return area<square_femtometre, long double>(l); }
// pm2
constexpr auto operator"" _q_pm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_picometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pm2(long double l) { return area<square_picometre, long double>(l); }
// nm2
constexpr auto operator"" _q_nm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_nanometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nm2(long double l) { return area<square_nanometre, long double>(l); }
// um2
constexpr auto operator"" _q_um2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_micrometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_um2(long double l) { return area<square_micrometre, long double>(l); }
// mm2
constexpr auto operator"" _q_mm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_millimetre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mm2(long double l) { return area<square_millimetre, long double>(l); }
// cm2
constexpr auto operator"" _q_cm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_centimetre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cm2(long double l) { return area<square_centimetre, long double>(l); }
// dm2
constexpr auto operator"" _q_dm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_decimetre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dm2(long double l) { return area<square_decimetre, long double>(l); }
// dam2
constexpr auto operator"" _q_dam2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_decametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dam2(long double l) { return area<square_decametre, long double>(l); }
// hm2
constexpr auto operator"" _q_hm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_hectometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hm2(long double l) { return area<square_hectometre, long double>(l); }
// km2
constexpr auto operator"" _q_km2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_kilometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_km2(long double l) { return area<square_kilometre, long double>(l); }
// Mm2
constexpr auto operator"" _q_Mm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_megametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Mm2(long double l) { return area<square_megametre, long double>(l); }
// Gm2
constexpr auto operator"" _q_Gm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_gigametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Gm2(long double l) { return area<square_gigametre, long double>(l); }
// Tm2
constexpr auto operator"" _q_Tm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_terametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Tm2(long double l) { return area<square_terametre, long double>(l); }
// Pm2
constexpr auto operator"" _q_Pm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_petametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Pm2(long double l) { return area<square_petametre, long double>(l); }
// Em2
constexpr auto operator"" _q_Em2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_exametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Em2(long double l) { return area<square_exametre, long double>(l); }
// Zm2
constexpr auto operator"" _q_Zm2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_zettametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Zm2(long double l) { return area<square_zettametre, long double>(l); }
// Ym2
constexpr auto operator"" _q_Ym2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<square_yottametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Ym2(long double l) { return area<square_yottametre, long double>(l); }
// ha
constexpr auto operator"" _q_ha(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return area<hectare, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ha(long double l) { return area<hectare, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,174 @@
// 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/isq/dimensions/capacitance.h>
#include <units/isq/si/electric_charge.h>
#include <units/isq/si/voltage.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct farad : named_unit<farad, "F", prefix> {};
struct yoctofarad : prefixed_unit<yoctofarad, yocto, farad> {};
struct zeptofarad : prefixed_unit<zeptofarad, zepto, farad> {};
struct attofarad : prefixed_unit<attofarad, atto, farad> {};
struct femtofarad : prefixed_unit<femtofarad, femto, farad> {};
struct picofarad : prefixed_unit<picofarad, pico, farad> {};
struct nanofarad : prefixed_unit<nanofarad, nano, farad> {};
struct microfarad : prefixed_unit<microfarad, micro, farad> {};
struct millifarad : prefixed_unit<millifarad, milli, farad> {};
struct centifarad : prefixed_unit<centifarad, centi, farad> {};
struct decifarad : prefixed_unit<decifarad, deci, farad> {};
struct decafarad : prefixed_unit<decafarad, deca, farad> {};
struct hectofarad : prefixed_unit<hectofarad, hecto, farad> {};
struct kilofarad : prefixed_unit<kilofarad, kilo, farad> {};
struct megafarad : prefixed_unit<megafarad, mega, farad> {};
struct gigafarad : prefixed_unit<gigafarad, giga, farad> {};
struct terafarad : prefixed_unit<terafarad, tera, farad> {};
struct petafarad : prefixed_unit<petafarad, peta, farad> {};
struct exafarad : prefixed_unit<exafarad, exa, farad> {};
struct zettafarad : prefixed_unit<zettafarad, zetta, farad> {};
struct yottafarad : prefixed_unit<yottafarad, yotta, farad> {};
struct dim_capacitance : isq::dim_capacitance<dim_capacitance, farad, dim_electric_charge, dim_voltage> {};
template<UnitOf<dim_capacitance> U, QuantityValue Rep = double>
using capacitance = quantity<dim_capacitance, U, Rep>;
inline namespace literals {
// F
constexpr auto operator"" _q_F(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<farad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_F(long double l) { return capacitance<farad, long double>(l); }
// yF
constexpr auto operator"" _q_yF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<yoctofarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yF(long double l) { return capacitance<yoctofarad, long double>(l); }
// zF
constexpr auto operator"" _q_zF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<zeptofarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zF(long double l) { return capacitance<zeptofarad, long double>(l); }
// aF
constexpr auto operator"" _q_aF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<attofarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aF(long double l) { return capacitance<attofarad, long double>(l); }
// fF
constexpr auto operator"" _q_fF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<femtofarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fF(long double l) { return capacitance<femtofarad, long double>(l); }
// pF
constexpr auto operator"" _q_pF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<picofarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pF(long double l) { return capacitance<picofarad, long double>(l); }
// nF
constexpr auto operator"" _q_nF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<nanofarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nF(long double l) { return capacitance<nanofarad, long double>(l); }
// uF
constexpr auto operator"" _q_uF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<microfarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uF(long double l) { return capacitance<microfarad, long double>(l); }
// mF
constexpr auto operator"" _q_mF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<millifarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mF(long double l) { return capacitance<millifarad, long double>(l); }
// cF
constexpr auto operator"" _q_cF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<centifarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cF(long double l) { return capacitance<centifarad, long double>(l); }
// dF
constexpr auto operator"" _q_dF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<decifarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dF(long double l) { return capacitance<decifarad, long double>(l); }
// daF
constexpr auto operator"" _q_daF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<decafarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_daF(long double l) { return capacitance<decafarad, long double>(l); }
// hF
constexpr auto operator"" _q_hF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<hectofarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hF(long double l) { return capacitance<hectofarad, long double>(l); }
// kF
constexpr auto operator"" _q_kF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<kilofarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kF(long double l) { return capacitance<kilofarad, long double>(l); }
// MF
constexpr auto operator"" _q_MF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<megafarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MF(long double l) { return capacitance<megafarad, long double>(l); }
// GF
constexpr auto operator"" _q_GF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<gigafarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GF(long double l) { return capacitance<gigafarad, long double>(l); }
// TF
constexpr auto operator"" _q_TF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<terafarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TF(long double l) { return capacitance<terafarad, long double>(l); }
// PF
constexpr auto operator"" _q_PF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<petafarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PF(long double l) { return capacitance<petafarad, long double>(l); }
// EF
constexpr auto operator"" _q_EF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<exafarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EF(long double l) { return capacitance<exafarad, long double>(l); }
// ZF
constexpr auto operator"" _q_ZF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<zettafarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZF(long double l) { return capacitance<zettafarad, long double>(l); }
// YF
constexpr auto operator"" _q_YF(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return capacitance<yottafarad, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YF(long double l) { return capacitance<yottafarad, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,182 @@
// 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/isq/dimensions/catalytic_activity.h>
#include <units/isq/si/amount_of_substance.h>
#include <units/isq/si/time.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct katal : named_unit<katal, "kat", prefix> {};
struct yoctokatal : prefixed_unit<yoctokatal, yocto, katal> {};
struct zeptokatal : prefixed_unit<zeptokatal, zepto, katal> {};
struct attokatal : prefixed_unit<attokatal, atto, katal> {};
struct femtokatal : prefixed_unit<femtokatal, femto, katal> {};
struct picokatal : prefixed_unit<picokatal, pico, katal> {};
struct nanokatal : prefixed_unit<nanokatal, nano, katal> {};
struct microkatal : prefixed_unit<microkatal, micro, katal> {};
struct millikatal : prefixed_unit<millikatal, milli, katal> {};
struct centikatal : prefixed_unit<centikatal, centi, katal> {};
struct decikatal : prefixed_unit<decikatal, deci, katal> {};
struct decakatal : prefixed_unit<decakatal, deca, katal> {};
struct hectokatal : prefixed_unit<hectokatal, hecto, katal> {};
struct kilokatal : prefixed_unit<kilokatal, kilo, katal> {};
struct megakatal : prefixed_unit<megakatal, mega, katal> {};
struct gigakatal : prefixed_unit<gigakatal, giga, katal> {};
struct terakatal : prefixed_unit<terakatal, tera, katal> {};
struct petakatal : prefixed_unit<petakatal, peta, katal> {};
struct exakatal : prefixed_unit<exakatal, exa, katal> {};
struct zettakatal : prefixed_unit<zettakatal, zetta, katal> {};
struct yottakatal : prefixed_unit<yottakatal, yotta, katal> {};
struct enzyme_unit : named_scaled_unit<enzyme_unit, "U", prefix, ratio(1, 60, -6), katal> {};
struct dim_catalytic_activity : isq::dim_catalytic_activity<dim_catalytic_activity, katal, dim_time, dim_amount_of_substance> {};
template<UnitOf<dim_catalytic_activity> U, QuantityValue Rep = double>
using catalytic_activity = quantity<dim_catalytic_activity, U, Rep>;
inline namespace literals {
// kat
constexpr auto operator"" _q_kat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<katal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kat(long double l) { return catalytic_activity<katal, long double>(l); }
// ykat
constexpr auto operator"" _q_ykat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<yoctokatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ykat(long double l) { return catalytic_activity<yoctokatal, long double>(l); }
// zkat
constexpr auto operator"" _q_zkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<zeptokatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zkat(long double l) { return catalytic_activity<zeptokatal, long double>(l); }
// akat
constexpr auto operator"" _q_akat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<attokatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_akat(long double l) { return catalytic_activity<attokatal, long double>(l); }
// fkat
constexpr auto operator"" _q_fkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<femtokatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fkat(long double l) { return catalytic_activity<femtokatal, long double>(l); }
// pkat
constexpr auto operator"" _q_pkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<picokatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pkat(long double l) { return catalytic_activity<picokatal, long double>(l); }
// nkat
constexpr auto operator"" _q_nkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<nanokatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nkat(long double l) { return catalytic_activity<nanokatal, long double>(l); }
// ukat
constexpr auto operator"" _q_ukat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<microkatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ukat(long double l) { return catalytic_activity<microkatal, long double>(l); }
// mkat
constexpr auto operator"" _q_mkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<millikatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mkat(long double l) { return catalytic_activity<millikatal, long double>(l); }
// ckat
constexpr auto operator"" _q_ckat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<centikatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ckat(long double l) { return catalytic_activity<centikatal, long double>(l); }
// dkat
constexpr auto operator"" _q_dkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<decikatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dkat(long double l) { return catalytic_activity<decikatal, long double>(l); }
// dakat
constexpr auto operator"" _q_dakat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<decakatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dakat(long double l) { return catalytic_activity<decakatal, long double>(l); }
// hkat
constexpr auto operator"" _q_hkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<hectokatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hkat(long double l) { return catalytic_activity<hectokatal, long double>(l); }
// kkat
constexpr auto operator"" _q_kkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<kilokatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kkat(long double l) { return catalytic_activity<kilokatal, long double>(l); }
// Mkat
constexpr auto operator"" _q_Mkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<megakatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Mkat(long double l) { return catalytic_activity<megakatal, long double>(l); }
// Gkat
constexpr auto operator"" _q_Gkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<gigakatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Gkat(long double l) { return catalytic_activity<gigakatal, long double>(l); }
// Tkat
constexpr auto operator"" _q_Tkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<terakatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Tkat(long double l) { return catalytic_activity<terakatal, long double>(l); }
// Pkat
constexpr auto operator"" _q_Pkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<petakatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Pkat(long double l) { return catalytic_activity<petakatal, long double>(l); }
// Ekat
constexpr auto operator"" _q_Ekat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<exakatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Ekat(long double l) { return catalytic_activity<exakatal, long double>(l); }
// Zkat
constexpr auto operator"" _q_Zkat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<zettakatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Zkat(long double l) { return catalytic_activity<zettakatal, long double>(l); }
// Ykat
constexpr auto operator"" _q_Ykat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<yottakatal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Ykat(long double l) { return catalytic_activity<yottakatal, long double>(l); }
// U
constexpr auto operator"" _q_U(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return catalytic_activity<enzyme_unit, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_U(long double l) { return catalytic_activity<enzyme_unit, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,57 @@
// 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/isq/dimensions/charge_density.h>
#include <units/isq/si/electric_charge.h>
#include <units/isq/si/length.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct coulomb_per_metre_cub : unit<coulomb_per_metre_cub> {};
struct coulomb_per_metre_sq : unit<coulomb_per_metre_sq> {};
struct dim_charge_density : isq::dim_charge_density<dim_charge_density, coulomb_per_metre_cub, dim_electric_charge, dim_length> {};
struct dim_surface_charge_density : isq::dim_surface_charge_density<dim_surface_charge_density, coulomb_per_metre_sq, dim_electric_charge, dim_length> {};
template<UnitOf<dim_charge_density> U, QuantityValue Rep = double>
using charge_density = quantity<dim_charge_density, U, Rep>;
template<UnitOf<dim_surface_charge_density> U, QuantityValue Rep = double>
using surface_charge_density = quantity<dim_surface_charge_density, U, Rep>;
inline namespace literals {
// C/m³
constexpr auto operator"" _q_C_per_m3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return charge_density<coulomb_per_metre_cub, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_C_per_m3(long double l) { return charge_density<coulomb_per_metre_cub, long double>(l); }
// C/m²
constexpr auto operator"" _q_C_per_m2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return surface_charge_density<coulomb_per_metre_sq, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_C_per_m2(long double l) { return surface_charge_density<coulomb_per_metre_sq, long double>(l); }
} // namespace literals
} // namespace units::isq::si
@@ -0,0 +1,47 @@
// 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/isq/dimensions/concentration.h>
#include <units/isq/si/length.h>
#include <units/isq/si/amount_of_substance.h>
#include <units/quantity.h>
namespace units::isq::si {
struct mol_per_metre_cub : unit<mol_per_metre_cub> {};
struct dim_concentration : isq::dim_concentration<dim_concentration, mol_per_metre_cub, dim_amount_of_substance, dim_length> {};
template<UnitOf<dim_concentration> U, QuantityValue Rep = double>
using concentration = quantity<dim_concentration, U, Rep>;
inline namespace literals {
// mol/m³
constexpr auto operator"" _q_mol_per_m3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return concentration<mol_per_metre_cub, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mol_per_m3(long double l) { return concentration<mol_per_metre_cub, long double>(l); }
} // namespace literals
} // namespace units::isq::si
@@ -0,0 +1,150 @@
// 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/isq/dimensions/conductance.h>
#include <units/isq/si/resistance.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct siemens : named_unit<siemens, "S", prefix> {};
struct yoctosiemens : prefixed_unit<yoctosiemens, yocto, siemens> {};
struct zeptosiemens : prefixed_unit<zeptosiemens, zepto, siemens> {};
struct attosiemens : prefixed_unit<attosiemens, atto, siemens> {};
struct femtosiemens : prefixed_unit<femtosiemens, femto, siemens> {};
struct picosiemens : prefixed_unit<picosiemens, pico, siemens> {};
struct nanosiemens : prefixed_unit<nanosiemens, nano, siemens> {};
struct microsiemens : prefixed_unit<microsiemens, micro, siemens> {};
struct millisiemens : prefixed_unit<millisiemens, milli, siemens> {};
struct kilosiemens : prefixed_unit<kilosiemens, kilo, siemens> {};
struct megasiemens : prefixed_unit<megasiemens, mega, siemens> {};
struct gigasiemens : prefixed_unit<gigasiemens, giga, siemens> {};
struct terasiemens : prefixed_unit<terasiemens, tera, siemens> {};
struct petasiemens : prefixed_unit<petasiemens, peta, siemens> {};
struct exasiemens : prefixed_unit<exasiemens, exa, siemens> {};
struct zettasiemens : prefixed_unit<zettasiemens, zetta, siemens> {};
struct yottasiemens : prefixed_unit<yottasiemens, yotta, siemens> {};
struct dim_conductance : isq::dim_conductance<dim_conductance, siemens, dim_resistance> {};
template<UnitOf<dim_conductance> U, QuantityValue Rep = double>
using conductance = quantity<dim_conductance, U, Rep>;
inline namespace literals {
// R
constexpr auto operator"" _q_S(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<siemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_S(long double l) { return conductance<siemens, long double>(l); }
// yS
constexpr auto operator"" _q_yS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<yoctosiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yS(long double l) { return conductance<yoctosiemens, long double>(l); }
// zS
constexpr auto operator"" _q_zS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<zeptosiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zS(long double l) { return conductance<zeptosiemens, long double>(l); }
// aS
constexpr auto operator"" _q_aS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<attosiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aS(long double l) { return conductance<attosiemens, long double>(l); }
// fS
constexpr auto operator"" _q_fS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<femtosiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fS(long double l) { return conductance<femtosiemens, long double>(l); }
// pS
constexpr auto operator"" _q_pS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<picosiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pS(long double l) { return conductance<picosiemens, long double>(l); }
// nS
constexpr auto operator"" _q_nS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<nanosiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nS(long double l) { return conductance<nanosiemens, long double>(l); }
// µS
constexpr auto operator"" _q_uS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<microsiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uS(long double l) { return conductance<microsiemens, long double>(l); }
// mS
constexpr auto operator"" _q_mS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<millisiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mS(long double l) { return conductance<millisiemens, long double>(l); }
// kS
constexpr auto operator"" _q_kS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<kilosiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kS(long double l) { return conductance<kilosiemens, long double>(l); }
// MS
constexpr auto operator"" _q_MS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<megasiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MS(long double l) { return conductance<megasiemens, long double>(l); }
// GS
constexpr auto operator"" _q_GS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<gigasiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GS(long double l) { return conductance<gigasiemens, long double>(l); }
// TS
constexpr auto operator"" _q_TS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<terasiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TS(long double l) { return conductance<terasiemens, long double>(l); }
// PS
constexpr auto operator"" _q_PS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<petasiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PS(long double l) { return conductance<petasiemens, long double>(l); }
// ES
constexpr auto operator"" _q_ES(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<exasiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ES(long double l) { return conductance<exasiemens, long double>(l); }
// ZS
constexpr auto operator"" _q_ZS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<zettasiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZS(long double l) { return conductance<zettasiemens, long double>(l); }
// YS
constexpr auto operator"" _q_YS(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return conductance<yottasiemens, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YS(long double l) { return conductance<yottasiemens, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,62 @@
// 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/isq/si/amount_of_substance.h>
#include <units/isq/si/thermodynamic_temperature.h>
#include <units/isq/si/electric_charge.h>
#include <units/isq/si/energy.h>
#include <units/isq/si/frequency.h>
#include <units/isq/si/power.h>
#include <units/isq/si/speed.h>
namespace units::isq::si::si2019 {
template<QuantityValue Rep = double>
inline constexpr auto planck_constant = energy<joule, Rep>(6.62607015e-34) * time<second, Rep>(1);
template<QuantityValue Rep = double>
inline constexpr auto reduced_planck_constant = energy<gigaelectronvolt, Rep>(6.582119569e-10) * time<second, Rep>(1);
template<QuantityValue Rep = double>
inline constexpr auto elementary_charge = electric_charge<coulomb, Rep>(1.602176634e-19);
template<QuantityValue Rep = double>
inline constexpr auto boltzmann_constant = energy<joule, Rep>(1.380649e-23) / temperature<kelvin, Rep>(1);
template<QuantityValue Rep = double>
inline constexpr auto avogadro_constant = Rep(6.02214076e23) / substance<mole, Rep>(1);
template<QuantityValue Rep = double>
inline constexpr auto speed_of_light = speed<metre_per_second, Rep>(299'792'458);
template<QuantityValue Rep = double>
inline constexpr auto hyperfine_structure_transition_frequency = frequency<hertz, Rep>(9'192'631'770);
// template<QuantityValue Rep = double>
// inline constexpr auto luminous_efficacy = 683_q_lm / 1_q_W;
template<QuantityValue Rep = double>
inline constexpr auto standard_gravity = acceleration<metre_per_second_sq, Rep>(9.80665);
} // namespace units::isq::si::si2019
@@ -0,0 +1,48 @@
// 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/isq/dimensions/current_density.h>
#include <units/isq/si/electric_current.h>
#include <units/isq/si/length.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct ampere_per_metre_sq : unit<ampere_per_metre_sq> {};
struct dim_current_density : isq::dim_current_density<dim_current_density, ampere_per_metre_sq, dim_electric_current, dim_length> {};
template<UnitOf<dim_current_density> U, QuantityValue Rep = double>
using current_density = quantity<dim_current_density, U, Rep>;
inline namespace literals {
// A / m²
constexpr auto operator"" _q_A_per_m2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return current_density<ampere_per_metre_sq, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_A_per_m2(long double l) { return current_density<ampere_per_metre_sq, long double>(l); }
} // namespace literals
} // namespace units::isq::si
@@ -0,0 +1,48 @@
// 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/isq/dimensions/density.h>
#include <units/isq/si/mass.h>
#include <units/isq/si/length.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct kilogram_per_metre_cub : unit<kilogram_per_metre_cub> {};
struct dim_density : isq::dim_density<dim_density, kilogram_per_metre_cub, dim_mass, dim_length> {};
template<UnitOf<dim_density> U, QuantityValue Rep = double>
using density = quantity<dim_density, U, Rep>;
inline namespace literals {
// kg / m³
constexpr auto operator"" _q_kg_per_m3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return density<kilogram_per_metre_cub, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kg_per_m3(long double l) { return density<kilogram_per_metre_cub, long double>(l); }
} // namespace literals
} // namespace units::isq::si
@@ -0,0 +1,53 @@
// 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/isq/dimensions/dynamic_viscosity.h>
#include <units/isq/si/time.h>
#include <units/isq/si/pressure.h>
#include <units/quantity.h>
namespace units::isq::si {
struct pascal_second : unit<pascal_second> {};
struct dim_dynamic_viscosity : isq::dim_dynamic_viscosity<dim_dynamic_viscosity, pascal_second, dim_pressure, dim_time> {};
template<UnitOf<dim_dynamic_viscosity> U, QuantityValue Rep = double>
using dynamic_viscosity = quantity<dim_dynamic_viscosity, U, Rep>;
inline namespace literals {
// Pa·s
constexpr auto operator"" _q_Pa_s(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return dynamic_viscosity<pascal_second, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Pa_s(long double l) { return dynamic_viscosity<pascal_second, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto Pa_s = dynamic_viscosity<pascal_second, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,53 @@
// 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/isq/dimensions/electric_charge.h>
#include <units/isq/si/electric_current.h>
#include <units/isq/si/time.h>
#include <units/quantity.h>
namespace units::isq::si {
struct coulomb : named_unit<coulomb, "C", prefix> {};
struct dim_electric_charge : isq::dim_electric_charge<dim_electric_charge, coulomb, dim_time, dim_electric_current> {};
template<UnitOf<dim_electric_charge> U, QuantityValue Rep = double>
using electric_charge = quantity<dim_electric_charge, U, Rep>;
inline namespace literals {
// C
constexpr auto operator"" _q_C(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_charge<coulomb, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_C(long double l) { return electric_charge<coulomb, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto C = electric_charge<coulomb, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,173 @@
// 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/one_rep.h>
#include <units/isq/dimensions/electric_current.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct ampere : named_unit<ampere, "A", prefix> {};
struct yoctoampere : prefixed_unit<yoctoampere, yocto, ampere> {};
struct zeptoampere : prefixed_unit<zeptoampere, zepto, ampere> {};
struct attoampere : prefixed_unit<attoampere, atto, ampere> {};
struct femtoampere : prefixed_unit<femtoampere, femto, ampere> {};
struct picoampere : prefixed_unit<picoampere, pico, ampere> {};
struct nanoampere : prefixed_unit<nanoampere, nano, ampere> {};
struct microampere : prefixed_unit<microampere, micro, ampere> {};
struct milliampere : prefixed_unit<milliampere, milli, ampere> {};
struct centiampere : prefixed_unit<centiampere, centi, ampere> {};
struct deciampere : prefixed_unit<deciampere, deci, ampere> {};
struct decaampere : prefixed_unit<decaampere, deca, ampere> {};
struct hectoampere : prefixed_unit<hectoampere, hecto, ampere> {};
struct kiloampere : prefixed_unit<kiloampere, kilo, ampere> {};
struct megaampere : prefixed_unit<megaampere, mega, ampere> {};
struct gigaampere : prefixed_unit<gigaampere, giga, ampere> {};
struct teraampere : prefixed_unit<teraampere, tera, ampere> {};
struct petaampere : prefixed_unit<petaampere, peta, ampere> {};
struct exaampere : prefixed_unit<exaampere, exa, ampere> {};
struct zettaampere : prefixed_unit<zettaampere, zetta, ampere> {};
struct yottaampere : prefixed_unit<yottaampere, yotta, ampere> {};
struct dim_electric_current : isq::dim_electric_current<ampere> {};
template<UnitOf<dim_electric_current> U, QuantityValue Rep = double>
using electric_current = quantity<dim_electric_current, U, Rep>;
inline namespace literals {
// A
constexpr auto operator"" _q_A(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<ampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_A(long double l) { return electric_current<ampere, long double>(l); }
// yA
constexpr auto operator"" _q_yA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<yoctoampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yA(long double l) { return electric_current<yoctoampere, long double>(l); }
// zA
constexpr auto operator"" _q_zA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<zeptoampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zA(long double l) { return electric_current<zeptoampere, long double>(l); }
// aA
constexpr auto operator"" _q_aA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<attoampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aA(long double l) { return electric_current<attoampere, long double>(l); }
// fA
constexpr auto operator"" _q_fA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<femtoampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fA(long double l) { return electric_current<femtoampere, long double>(l); }
// pA
constexpr auto operator"" _q_pA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<picoampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pA(long double l) { return electric_current<picoampere, long double>(l); }
// nA
constexpr auto operator"" _q_nA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<nanoampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nA(long double l) { return electric_current<nanoampere, long double>(l); }
// uA
constexpr auto operator"" _q_uA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<microampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uA(long double l) { return electric_current<microampere, long double>(l); }
// mA
constexpr auto operator"" _q_mA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<milliampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mA(long double l) { return electric_current<milliampere, long double>(l); }
// cA
constexpr auto operator"" _q_cA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<centiampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cA(long double l) { return electric_current<centiampere, long double>(l); }
// dA
constexpr auto operator"" _q_dA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<deciampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dA(long double l) { return electric_current<deciampere, long double>(l); }
// daA
constexpr auto operator"" _q_daA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<decaampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_daA(long double l) { return electric_current<decaampere, long double>(l); }
// hA
constexpr auto operator"" _q_hA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<hectoampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hA(long double l) { return electric_current<hectoampere, long double>(l); }
// kA
constexpr auto operator"" _q_kA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<kiloampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kA(long double l) { return electric_current<kiloampere, long double>(l); }
// MA
constexpr auto operator"" _q_MA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<megaampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MA(long double l) { return electric_current<megaampere, long double>(l); }
// GA
constexpr auto operator"" _q_GA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<gigaampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GA(long double l) { return electric_current<gigaampere, long double>(l); }
// TA
constexpr auto operator"" _q_TA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<teraampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TA(long double l) { return electric_current<teraampere, long double>(l); }
// PA
constexpr auto operator"" _q_PA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<petaampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PA(long double l) { return electric_current<petaampere, long double>(l); }
// EA
constexpr auto operator"" _q_EA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<exaampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EA(long double l) { return electric_current<exaampere, long double>(l); }
// ZA
constexpr auto operator"" _q_ZA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<zettaampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZA(long double l) { return electric_current<zettaampere, long double>(l); }
// YA
constexpr auto operator"" _q_YA(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_current<yottaampere, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YA(long double l) { return electric_current<yottaampere, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,45 @@
// 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/isq/dimensions/electric_field_strength.h>
#include <units/isq/si/voltage.h>
#include <units/quantity.h>
namespace units::isq::si {
struct volt_per_metre : unit<volt_per_metre> {};
struct dim_electric_field_strength : isq::dim_electric_field_strength<dim_electric_field_strength, volt_per_metre, dim_voltage, dim_length> {};
template<UnitOf<dim_electric_field_strength> U, QuantityValue Rep = double>
using electric_field_strength = quantity<dim_electric_field_strength, U, Rep>;
inline namespace literals {
// V/m
constexpr auto operator"" _q_V_per_m(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return electric_field_strength<volt_per_metre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_V_per_m(long double l) { return electric_field_strength<volt_per_metre, long double>(l); }
} // namespace literals
} // namespace units::isq::si
@@ -0,0 +1,162 @@
// 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/isq/dimensions/energy.h>
#include <units/isq/si/force.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct joule : named_unit<joule, "J", prefix> {};
struct yoctojoule : prefixed_unit<yoctojoule, yocto, joule> {};
struct zeptojoule : prefixed_unit<zeptojoule, zepto, joule> {};
struct attojoule : prefixed_unit<attojoule, atto, joule> {};
struct femtojoule : prefixed_unit<femtojoule, femto, joule> {};
struct picojoule : prefixed_unit<picojoule, pico, joule> {};
struct nanojoule : prefixed_unit<nanojoule, nano, joule> {};
struct microjoule : prefixed_unit<microjoule, micro, joule> {};
struct millijoule : prefixed_unit<millijoule, milli, joule> {};
struct kilojoule : prefixed_unit<kilojoule, kilo, joule> {};
struct megajoule : prefixed_unit<megajoule, mega, joule> {};
struct gigajoule : prefixed_unit<gigajoule, giga, joule> {};
struct terajoule : prefixed_unit<terajoule, tera, joule> {};
struct petajoule : prefixed_unit<petajoule, peta, joule> {};
struct exajoule : prefixed_unit<exajoule, exa, joule> {};
struct zettajoule : prefixed_unit<zettajoule, zetta, joule> {};
struct yottajoule : prefixed_unit<yottajoule, yotta, joule> {};
struct electronvolt : named_scaled_unit<electronvolt, "eV", prefix, ratio(1'602'176'634, 1'000'000'000, -19), joule> {};
struct gigaelectronvolt : prefixed_unit<gigaelectronvolt, giga, electronvolt> {};
struct dim_energy : isq::dim_energy<dim_energy, joule, dim_force, dim_length> {};
template<UnitOf<dim_energy> U, QuantityValue Rep = double>
using energy = quantity<dim_energy, U, Rep>;
inline namespace literals {
// J
constexpr auto operator"" _q_J(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<joule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_J(long double l) { return energy<joule, long double>(l); }
// yJ
constexpr auto operator"" _q_yJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<yoctojoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yJ(long double l) { return energy<yoctojoule, long double>(l); }
// zJ
constexpr auto operator"" _q_zJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<zeptojoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zJ(long double l) { return energy<zeptojoule, long double>(l); }
// aJ
constexpr auto operator"" _q_aJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<attojoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aJ(long double l) { return energy<attojoule, long double>(l); }
// fJ
constexpr auto operator"" _q_fJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<femtojoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fJ(long double l) { return energy<femtojoule, long double>(l); }
// pJ
constexpr auto operator"" _q_pJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<picojoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pJ(long double l) { return energy<picojoule, long double>(l); }
// nJ
constexpr auto operator"" _q_nJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<nanojoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nJ(long double l) { return energy<nanojoule, long double>(l); }
// uJ
constexpr auto operator"" _q_uJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<microjoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uJ(long double l) { return energy<microjoule, long double>(l); }
// mJ
constexpr auto operator"" _q_mJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<millijoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mJ(long double l) { return energy<millijoule, long double>(l); }
// kJ
constexpr auto operator"" _q_kJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<kilojoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kJ(long double l) { return energy<kilojoule, long double>(l); }
// MJ
constexpr auto operator"" _q_MJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<megajoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MJ(long double l) { return energy<megajoule, long double>(l); }
// GJ
constexpr auto operator"" _q_GJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<gigajoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GJ(long double l) { return energy<gigajoule, long double>(l); }
// TJ
constexpr auto operator"" _q_TJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<terajoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TJ(long double l) { return energy<terajoule, long double>(l); }
// PJ
constexpr auto operator"" _q_PJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<petajoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PJ(long double l) { return energy<petajoule, long double>(l); }
// EJ
constexpr auto operator"" _q_EJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<exajoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EJ(long double l) { return energy<exajoule, long double>(l); }
// ZJ
constexpr auto operator"" _q_ZJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<zettajoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZJ(long double l) { return energy<zettajoule, long double>(l); }
// YJ
constexpr auto operator"" _q_YJ(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<yottajoule, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YJ(long double l) { return energy<yottajoule, long double>(l); }
// eV
constexpr auto operator"" _q_eV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<electronvolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_eV(long double l) { return energy<electronvolt, long double>(l); }
// GeV
constexpr auto operator"" _q_GeV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy<gigaelectronvolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GeV(long double l) { return energy<gigaelectronvolt, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,46 @@
// 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/isq/dimensions/energy_density.h>
#include <units/isq/si/energy.h>
#include <units/isq/si/volume.h>
#include <units/quantity.h>
namespace units::isq::si {
struct joule_per_metre_cub : unit<joule_per_metre_cub> {};
struct dim_energy_density : isq::dim_energy_density<dim_energy_density, joule_per_metre_cub, dim_energy, dim_volume> {};
template<UnitOf<dim_energy_density> U, QuantityValue Rep = double>
using energy_density = quantity<dim_energy_density, U, Rep>;
inline namespace literals {
// N/m
constexpr auto operator"" _q_J_per_m3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return energy_density<joule_per_metre_cub, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_J_per_m3(long double l) { return energy_density<joule_per_metre_cub, long double>(l); }
} // namespace literals
} // namespace units::isq::si
+174
View File
@@ -0,0 +1,174 @@
// 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/isq/dimensions/force.h>
#include <units/isq/si/acceleration.h>
#include <units/isq/si/mass.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct newton : named_unit<newton, "N", prefix> {};
struct yoctonewton : prefixed_unit<yoctonewton, yocto, newton> {};
struct zeptonewton : prefixed_unit<zeptonewton, zepto, newton> {};
struct attonewton : prefixed_unit<attonewton, atto, newton> {};
struct femtonewton : prefixed_unit<femtonewton, femto, newton> {};
struct piconewton : prefixed_unit<piconewton, pico, newton> {};
struct nanonewton : prefixed_unit<nanonewton, nano, newton> {};
struct micronewton : prefixed_unit<micronewton, micro, newton> {};
struct millinewton : prefixed_unit<millinewton, milli, newton> {};
struct centinewton : prefixed_unit<centinewton, centi, newton> {};
struct decinewton : prefixed_unit<decinewton, deci, newton> {};
struct decanewton : prefixed_unit<decanewton, deca, newton> {};
struct hectonewton : prefixed_unit<hectonewton, hecto, newton> {};
struct kilonewton : prefixed_unit<kilonewton, kilo, newton> {};
struct meganewton : prefixed_unit<meganewton, mega, newton> {};
struct giganewton : prefixed_unit<giganewton, giga, newton> {};
struct teranewton : prefixed_unit<teranewton, tera, newton> {};
struct petanewton : prefixed_unit<petanewton, peta, newton> {};
struct exanewton : prefixed_unit<exanewton, exa, newton> {};
struct zettanewton : prefixed_unit<zettanewton, zetta, newton> {};
struct yottanewton : prefixed_unit<yottanewton, yotta, newton> {};
struct dim_force : isq::dim_force<dim_force, newton, dim_mass, dim_acceleration> {};
template<UnitOf<dim_force> U, QuantityValue Rep = double>
using force = quantity<dim_force, U, Rep>;
inline namespace literals {
// N
constexpr auto operator"" _q_N(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<newton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_N(long double l) { return force<newton, long double>(l); }
// yN
constexpr auto operator"" _q_yN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<yoctonewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yN(long double l) { return force<yoctonewton, long double>(l); }
// zN
constexpr auto operator"" _q_zN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<zeptonewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zN(long double l) { return force<zeptonewton, long double>(l); }
// aN
constexpr auto operator"" _q_aN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<attonewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aN(long double l) { return force<attonewton, long double>(l); }
// fN
constexpr auto operator"" _q_fN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<femtonewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fN(long double l) { return force<femtonewton, long double>(l); }
// pN
constexpr auto operator"" _q_pN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<piconewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pN(long double l) { return force<piconewton, long double>(l); }
// nN
constexpr auto operator"" _q_nN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<nanonewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nN(long double l) { return force<nanonewton, long double>(l); }
// uN
constexpr auto operator"" _q_uN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<micronewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uN(long double l) { return force<micronewton, long double>(l); }
// mN
constexpr auto operator"" _q_mN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<millinewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mN(long double l) { return force<millinewton, long double>(l); }
// cN
constexpr auto operator"" _q_cN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<centinewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cN(long double l) { return force<centinewton, long double>(l); }
// dN
constexpr auto operator"" _q_dN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<decinewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dN(long double l) { return force<decinewton, long double>(l); }
// daN
constexpr auto operator"" _q_daN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<decanewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_daN(long double l) { return force<decanewton, long double>(l); }
// hN
constexpr auto operator"" _q_hN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<hectonewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hN(long double l) { return force<hectonewton, long double>(l); }
// kN
constexpr auto operator"" _q_kN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<kilonewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kN(long double l) { return force<kilonewton, long double>(l); }
// MN
constexpr auto operator"" _q_MN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<meganewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MN(long double l) { return force<meganewton, long double>(l); }
// GN
constexpr auto operator"" _q_GN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<giganewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GN(long double l) { return force<giganewton, long double>(l); }
// TN
constexpr auto operator"" _q_TN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<teranewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TN(long double l) { return force<teranewton, long double>(l); }
// PN
constexpr auto operator"" _q_PN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<petanewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PN(long double l) { return force<petanewton, long double>(l); }
// EN
constexpr auto operator"" _q_EN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<exanewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EN(long double l) { return force<exanewton, long double>(l); }
// ZN
constexpr auto operator"" _q_ZN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<zettanewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZN(long double l) { return force<zettanewton, long double>(l); }
// YN
constexpr auto operator"" _q_YN(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return force<yottanewton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YN(long double l) { return force<yottanewton, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,148 @@
// 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/isq/dimensions/frequency.h>
#include <units/isq/si/time.h>
#include <units/quantity.h>
namespace units::isq::si {
struct hertz : named_unit<hertz, "Hz", prefix> {};
struct yoctohertz : prefixed_unit<yoctohertz, yocto, hertz> {};
struct zeptohertz : prefixed_unit<zeptohertz, zepto, hertz> {};
struct attohertz : prefixed_unit<attohertz, atto, hertz> {};
struct femtohertz : prefixed_unit<femtohertz, femto, hertz> {};
struct picohertz : prefixed_unit<picohertz, pico, hertz> {};
struct nanohertz : prefixed_unit<nanohertz, nano, hertz> {};
struct microhertz : prefixed_unit<microhertz, micro, hertz> {};
struct millihertz : prefixed_unit<millihertz, milli, hertz> {};
struct kilohertz : prefixed_unit<kilohertz, kilo, hertz> {};
struct megahertz : prefixed_unit<megahertz, mega, hertz> {};
struct gigahertz : prefixed_unit<gigahertz, giga, hertz> {};
struct terahertz : prefixed_unit<terahertz, tera, hertz> {};
struct petahertz : prefixed_unit<petahertz, peta, hertz> {};
struct exahertz : prefixed_unit<exahertz, exa, hertz> {};
struct zettahertz : prefixed_unit<zettahertz, zetta, hertz> {};
struct yottahertz : prefixed_unit<yottahertz, yotta, hertz> {};
struct dim_frequency : isq::dim_frequency<dim_frequency, hertz, dim_time> {};
template<UnitOf<dim_frequency> U, QuantityValue Rep = double>
using frequency = quantity<dim_frequency, U, Rep>;
inline namespace literals {
// Hz
constexpr auto operator"" _q_Hz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<hertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Hz(long double l) { return frequency<hertz, long double>(l); }
// yHz
constexpr auto operator"" _q_yHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<yoctohertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yHz(long double l) { return frequency<yoctohertz, long double>(l); }
// zHz
constexpr auto operator"" _q_zHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<zeptohertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zHz(long double l) { return frequency<zeptohertz, long double>(l); }
// aHz
constexpr auto operator"" _q_aHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<attohertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aHz(long double l) { return frequency<attohertz, long double>(l); }
// fHz
constexpr auto operator"" _q_fHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<femtohertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fHz(long double l) { return frequency<femtohertz, long double>(l); }
// pHz
constexpr auto operator"" _q_pHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<picohertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pHz(long double l) { return frequency<picohertz, long double>(l); }
// nHz
constexpr auto operator"" _q_nHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<nanohertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nHz(long double l) { return frequency<nanohertz, long double>(l); }
// uHz
constexpr auto operator"" _q_uHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<microhertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uHz(long double l) { return frequency<microhertz, long double>(l); }
// mHz
constexpr auto operator"" _q_mHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<millihertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mHz(long double l) { return frequency<millihertz, long double>(l); }
// kHz
constexpr auto operator"" _q_kHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<kilohertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kHz(long double l) { return frequency<kilohertz, long double>(l); }
// MHz
constexpr auto operator"" _q_MHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<megahertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MHz(long double l) { return frequency<megahertz, long double>(l); }
// GHz
constexpr auto operator"" _q_GHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<gigahertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GHz(long double l) { return frequency<gigahertz, long double>(l); }
// THz
constexpr auto operator"" _q_THz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<terahertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_THz(long double l) { return frequency<terahertz, long double>(l); }
// PHz
constexpr auto operator"" _q_PHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<petahertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PHz(long double l) { return frequency<petahertz, long double>(l); }
// EHz
constexpr auto operator"" _q_EHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<exahertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EHz(long double l) { return frequency<exahertz, long double>(l); }
// ZHz
constexpr auto operator"" _q_ZHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<zettahertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZHz(long double l) { return frequency<zettahertz, long double>(l); }
// YHz
constexpr auto operator"" _q_YHz(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return frequency<yottahertz, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YHz(long double l) { return frequency<yottahertz, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,68 @@
// 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/isq/dimensions/heat_capacity.h>
#include <units/isq/si/thermodynamic_temperature.h>
#include <units/isq/si/energy.h>
#include <units/isq/si/mass.h>
#include <units/isq/si/amount_of_substance.h>
#include <units/quantity.h>
namespace units::isq::si {
struct joule_per_kelvin : unit<joule_per_kelvin> {};
struct joule_per_kilogram_kelvin : unit<joule_per_kilogram_kelvin> {};
struct joule_per_mole_kelvin : unit<joule_per_mole_kelvin> {};
struct dim_heat_capacity : isq::dim_heat_capacity<dim_heat_capacity, joule_per_kelvin, dim_energy, dim_thermodynamic_temperature> {};
struct dim_specific_heat_capacity : isq::dim_specific_heat_capacity<dim_specific_heat_capacity, joule_per_kilogram_kelvin, dim_heat_capacity, dim_mass> {};
struct dim_molar_heat_capacity : isq::dim_molar_heat_capacity<dim_molar_heat_capacity, joule_per_mole_kelvin, dim_heat_capacity, dim_amount_of_substance> {};
template<UnitOf<dim_heat_capacity> U, QuantityValue Rep = double>
using heat_capacity = quantity<dim_heat_capacity, U, Rep>;
template<UnitOf<dim_specific_heat_capacity> U, QuantityValue Rep = double>
using specific_heat_capacity = quantity<dim_specific_heat_capacity, U, Rep>;
template<UnitOf<dim_molar_heat_capacity> U, QuantityValue Rep = double>
using molar_heat_capacity = quantity<dim_molar_heat_capacity, U, Rep>;
inline namespace literals {
// J/K
constexpr auto operator"" _q_J_per_K(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return heat_capacity<joule_per_kelvin, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_J_per_K(long double l) { return heat_capacity<joule_per_kelvin, long double>(l); }
// J/(kg·K)
constexpr auto operator"" _q_J_per_kg_K(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return specific_heat_capacity<joule_per_kilogram_kelvin, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_J_per_kg_K(long double l) { return specific_heat_capacity<joule_per_kilogram_kelvin, long double>(l); }
// J/(mol·K)
constexpr auto operator"" _q_J_per_mol_K(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return molar_heat_capacity<joule_per_mole_kelvin, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_J_per_mol_K(long double l) { return molar_heat_capacity<joule_per_mole_kelvin, long double>(l); }
} // namespace literals
} // namespace units::isq::si
@@ -0,0 +1,150 @@
// 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/isq/dimensions/inductance.h>
#include <units/isq/si/magnetic_flux.h>
#include <units/isq/si/electric_current.h>
#include <units/quantity.h>
namespace units::isq::si {
struct henry : named_unit<henry, "H", prefix> {};
struct yoctohenry : prefixed_unit<yoctohenry, yocto, henry> {};
struct zeptohenry : prefixed_unit<zeptohenry, zepto, henry> {};
struct attohenry : prefixed_unit<attohenry, atto, henry> {};
struct femtohenry : prefixed_unit<femtohenry, femto, henry> {};
struct picohenry : prefixed_unit<picohenry, pico, henry> {};
struct nanohenry : prefixed_unit<nanohenry, nano, henry> {};
struct microhenry : prefixed_unit<microhenry, micro, henry> {};
struct millihenry : prefixed_unit<millihenry, milli, henry> {};
struct kilohenry : prefixed_unit<kilohenry, kilo, henry> {};
struct megahenry : prefixed_unit<megahenry, mega, henry> {};
struct gigahenry : prefixed_unit<gigahenry, giga, henry> {};
struct terahenry : prefixed_unit<terahenry, tera, henry> {};
struct petahenry : prefixed_unit<petahenry, peta, henry> {};
struct exahenry : prefixed_unit<exahenry, exa, henry> {};
struct zettahenry : prefixed_unit<zettahenry, zetta, henry> {};
struct yottahenry : prefixed_unit<yottahenry, yotta, henry> {};
struct dim_inductance : isq::dim_inductance<dim_inductance, henry, dim_magnetic_flux, dim_electric_current> {};
template<UnitOf<dim_inductance> U, QuantityValue Rep = double>
using inductance = quantity<dim_inductance, U, Rep>;
inline namespace literals {
// H
constexpr auto operator"" _q_H(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<henry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_H(long double l) { return inductance<henry, long double>(l); }
// yH
constexpr auto operator"" _q_yH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<yoctohenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yH(long double l) { return inductance<yoctohenry, long double>(l); }
// zH
constexpr auto operator"" _q_zH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<zeptohenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zH(long double l) { return inductance<zeptohenry, long double>(l); }
// aH
constexpr auto operator"" _q_aH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<attohenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aH(long double l) { return inductance<attohenry, long double>(l); }
// fH
constexpr auto operator"" _q_fH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<femtohenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fH(long double l) { return inductance<femtohenry, long double>(l); }
// pH
constexpr auto operator"" _q_pH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<picohenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pH(long double l) { return inductance<picohenry, long double>(l); }
// nH
constexpr auto operator"" _q_nH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<nanohenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nH(long double l) { return inductance<nanohenry, long double>(l); }
// µH
constexpr auto operator"" _q_uH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<microhenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uH(long double l) { return inductance<microhenry, long double>(l); }
// mH
constexpr auto operator"" _q_mH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<millihenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mH(long double l) { return inductance<millihenry, long double>(l); }
// kH
constexpr auto operator"" _q_kH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<kilohenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kH(long double l) { return inductance<kilohenry, long double>(l); }
// MH
constexpr auto operator"" _q_MH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<megahenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MH(long double l) { return inductance<megahenry, long double>(l); }
// GH
constexpr auto operator"" _q_GH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<gigahenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GH(long double l) { return inductance<gigahenry, long double>(l); }
// TH
constexpr auto operator"" _q_TH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<terahenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TH(long double l) { return inductance<terahenry, long double>(l); }
// PH
constexpr auto operator"" _q_PH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<petahenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PH(long double l) { return inductance<petahenry, long double>(l); }
// EH
constexpr auto operator"" _q_EH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<exahenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EH(long double l) { return inductance<exahenry, long double>(l); }
// ZH
constexpr auto operator"" _q_ZH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<zettahenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZH(long double l) { return inductance<zettahenry, long double>(l); }
// YH
constexpr auto operator"" _q_YH(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return inductance<yottahenry, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YH(long double l) { return inductance<yottahenry, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,180 @@
// 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/one_rep.h>
#include <units/isq/dimensions/length.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct metre : named_unit<metre, "m", prefix> {};
struct yoctometre : prefixed_unit<yoctometre, yocto, metre> {};
struct zeptometre : prefixed_unit<zeptometre, zepto, metre> {};
struct attometre : prefixed_unit<attometre, atto, metre> {};
struct femtometre : prefixed_unit<femtometre, femto, metre> {};
struct picometre : prefixed_unit<picometre, pico, metre> {};
struct nanometre : prefixed_unit<nanometre, nano, metre> {};
struct micrometre : prefixed_unit<micrometre, micro, metre> {};
struct millimetre : prefixed_unit<millimetre, milli, metre> {};
struct centimetre : prefixed_unit<centimetre, centi, metre> {};
struct decimetre : prefixed_unit<decimetre, deci, metre> {};
struct decametre : prefixed_unit<decametre, deca, metre> {};
struct hectometre : prefixed_unit<hectometre, hecto, metre> {};
struct kilometre : prefixed_unit<kilometre, kilo, metre> {};
struct megametre : prefixed_unit<megametre, mega, metre> {};
struct gigametre : prefixed_unit<gigametre, giga, metre> {};
struct terametre : prefixed_unit<terametre, tera, metre> {};
struct petametre : prefixed_unit<petametre, peta, metre> {};
struct exametre : prefixed_unit<exametre, exa, metre> {};
struct zettametre : prefixed_unit<zettametre, zetta, metre> {};
struct yottametre : prefixed_unit<yottametre, yotta, metre> {};
struct astronomical_unit : named_scaled_unit<astronomical_unit, "au", no_prefix, ratio(149'597'870'700), metre> {};
struct dim_length : isq::dim_length<metre> {};
template<UnitOf<dim_length> U, QuantityValue Rep = double>
using length = quantity<dim_length, U, Rep>;
inline namespace literals {
// m
constexpr auto operator"" _q_m(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<metre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_m(long double l) { return length<metre, long double>(l); }
// ym
constexpr auto operator"" _q_ym(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<yoctometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ym(long double l) { return length<yoctometre, long double>(l); }
// zm
constexpr auto operator"" _q_zm(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<zeptometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zm(long double l) { return length<zeptometre, long double>(l); }
// am
constexpr auto operator"" _q_am(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<attometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_am(long double l) { return length<attometre, long double>(l); }
// fm
constexpr auto operator"" _q_fm(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<femtometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fm(long double l) { return length<femtometre, long double>(l); }
// pm
constexpr auto operator"" _q_pm(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<picometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pm(long double l) { return length<picometre, long double>(l); }
// nm
constexpr auto operator"" _q_nm(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<nanometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nm(long double l) { return length<nanometre, long double>(l); }
// um
constexpr auto operator"" _q_um(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<micrometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_um(long double l) { return length<micrometre, long double>(l); }
// mm
constexpr auto operator"" _q_mm(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<millimetre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mm(long double l) { return length<millimetre, long double>(l); }
// cm
constexpr auto operator"" _q_cm(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<centimetre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cm(long double l) { return length<centimetre, long double>(l); }
// dm
constexpr auto operator"" _q_dm(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<decimetre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dm(long double l) { return length<decimetre, long double>(l); }
// dam
constexpr auto operator"" _q_dam(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<decametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dam(long double l) { return length<decametre, long double>(l); }
// hm
constexpr auto operator"" _q_hm(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<hectometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hm(long double l) { return length<hectometre, long double>(l); }
// km
constexpr auto operator"" _q_km(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<kilometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_km(long double l) { return length<kilometre, long double>(l); }
// Mm
constexpr auto operator"" _q_Mm(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<megametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Mm(long double l) { return length<megametre, long double>(l); }
// Gm
constexpr auto operator"" _q_Gm(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<gigametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Gm(long double l) { return length<gigametre, long double>(l); }
// Tm
constexpr auto operator"" _q_Tm(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<terametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Tm(long double l) { return length<terametre, long double>(l); }
// Pm
constexpr auto operator"" _q_Pm(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<petametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Pm(long double l) { return length<petametre, long double>(l); }
// Em
constexpr auto operator"" _q_Em(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<exametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Em(long double l) { return length<exametre, long double>(l); }
// Zm
constexpr auto operator"" _q_Zm(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<zettametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Zm(long double l) { return length<zettametre, long double>(l); }
// Ym
constexpr auto operator"" _q_Ym(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<yottametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Ym(long double l) { return length<yottametre, long double>(l); }
// au
constexpr auto operator"" _q_au(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return length<astronomical_unit, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_au(long double l) { return length<astronomical_unit, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,47 @@
// 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/isq/dimensions/luminance.h>
#include <units/isq/si/length.h>
#include <units/isq/si/luminous_intensity.h>
#include <units/quantity.h>
namespace units::isq::si {
struct candela_per_metre_sq : unit<candela_per_metre_sq> {};
struct dim_luminance : isq::dim_luminance<dim_luminance, candela_per_metre_sq, dim_luminous_intensity, dim_length> {};
template<UnitOf<dim_luminance> U, QuantityValue Rep = double>
using luminance = quantity<dim_luminance, U, Rep>;
inline namespace literals {
// cd/m²
constexpr auto operator"" _q_cd_per_m2(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminance<candela_per_metre_sq, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cd_per_m2(long double l) { return luminance<candela_per_metre_sq, long double>(l); }
} // namespace literals
} // namespace units::isq::si
@@ -0,0 +1,173 @@
// 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/one_rep.h>
#include <units/isq/dimensions/luminous_intensity.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct candela : named_unit<candela, "cd", prefix> {};
struct yoctocandela : prefixed_unit<yoctocandela, yocto, candela> {};
struct zeptocandela : prefixed_unit<zeptocandela, zepto, candela> {};
struct attocandela : prefixed_unit<attocandela, atto, candela> {};
struct femtocandela : prefixed_unit<femtocandela, femto, candela> {};
struct picocandela : prefixed_unit<picocandela, pico, candela> {};
struct nanocandela : prefixed_unit<nanocandela, nano, candela> {};
struct microcandela : prefixed_unit<microcandela, micro, candela> {};
struct millicandela : prefixed_unit<millicandela, milli, candela> {};
struct centicandela : prefixed_unit<centicandela, centi, candela> {};
struct decicandela : prefixed_unit<decicandela, deci, candela> {};
struct decacandela : prefixed_unit<decacandela, deca, candela> {};
struct hectocandela : prefixed_unit<hectocandela, hecto, candela> {};
struct kilocandela : prefixed_unit<kilocandela, kilo, candela> {};
struct megacandela : prefixed_unit<megacandela, mega, candela> {};
struct gigacandela : prefixed_unit<gigacandela, giga, candela> {};
struct teracandela : prefixed_unit<teracandela, tera, candela> {};
struct petacandela : prefixed_unit<petacandela, peta, candela> {};
struct exacandela : prefixed_unit<exacandela, exa, candela> {};
struct zettacandela : prefixed_unit<zettacandela, zetta, candela> {};
struct yottacandela : prefixed_unit<yottacandela, yotta, candela> {};
struct dim_luminous_intensity : isq::dim_luminous_intensity<candela> {};
template<UnitOf<dim_luminous_intensity> U, QuantityValue Rep = double>
using luminous_intensity = quantity<dim_luminous_intensity, U, Rep>;
inline namespace literals {
// cd
constexpr auto operator"" _q_cd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<candela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cd(long double l) { return luminous_intensity<candela, long double>(l); }
// ycd
constexpr auto operator"" _q_ycd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<yoctocandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ycd(long double l) { return luminous_intensity<yoctocandela, long double>(l); }
// zcd
constexpr auto operator"" _q_zcd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<zeptocandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zcd(long double l) { return luminous_intensity<zeptocandela, long double>(l); }
// acd
constexpr auto operator"" _q_acd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<attocandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_acd(long double l) { return luminous_intensity<attocandela, long double>(l); }
// fcd
constexpr auto operator"" _q_fcd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<femtocandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fcd(long double l) { return luminous_intensity<femtocandela, long double>(l); }
// pcd
constexpr auto operator"" _q_pcd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<picocandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pcd(long double l) { return luminous_intensity<picocandela, long double>(l); }
// ncd
constexpr auto operator"" _q_ncd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<nanocandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ncd(long double l) { return luminous_intensity<nanocandela, long double>(l); }
// ucd
constexpr auto operator"" _q_ucd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<microcandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ucd(long double l) { return luminous_intensity<microcandela, long double>(l); }
// mcd
constexpr auto operator"" _q_mcd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<millicandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mcd(long double l) { return luminous_intensity<millicandela, long double>(l); }
// ccd
constexpr auto operator"" _q_ccd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<centicandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ccd(long double l) { return luminous_intensity<centicandela, long double>(l); }
// dcd
constexpr auto operator"" _q_dcd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<decicandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dcd(long double l) { return luminous_intensity<decicandela, long double>(l); }
// dacd
constexpr auto operator"" _q_dacd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<decacandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dacd(long double l) { return luminous_intensity<decacandela, long double>(l); }
// hcd
constexpr auto operator"" _q_hcd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<hectocandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hcd(long double l) { return luminous_intensity<hectocandela, long double>(l); }
// kcd
constexpr auto operator"" _q_kcd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<kilocandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kcd(long double l) { return luminous_intensity<kilocandela, long double>(l); }
// Mcd
constexpr auto operator"" _q_Mcd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<megacandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Mcd(long double l) { return luminous_intensity<megacandela, long double>(l); }
// Gcd
constexpr auto operator"" _q_Gcd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<gigacandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Gcd(long double l) { return luminous_intensity<gigacandela, long double>(l); }
// Tcd
constexpr auto operator"" _q_Tcd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<teracandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Tcd(long double l) { return luminous_intensity<teracandela, long double>(l); }
// Pcd
constexpr auto operator"" _q_Pcd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<petacandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Pcd(long double l) { return luminous_intensity<petacandela, long double>(l); }
// Ecd
constexpr auto operator"" _q_Ecd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<exacandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Ecd(long double l) { return luminous_intensity<exacandela, long double>(l); }
// Zcd
constexpr auto operator"" _q_Zcd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<zettacandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Zcd(long double l) { return luminous_intensity<zettacandela, long double>(l); }
// Ycd
constexpr auto operator"" _q_Ycd(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return luminous_intensity<yottacandela, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Ycd(long double l) { return luminous_intensity<yottacandela, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,150 @@
// 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/isq/dimensions/magnetic_flux.h>
#include <units/isq/si/magnetic_induction.h>
#include <units/isq/si/area.h>
#include <units/quantity.h>
namespace units::isq::si {
struct weber : named_unit<weber, "Wb", prefix> {};
struct yoctoweber : prefixed_unit<yoctoweber, yocto, weber> {};
struct zeptoweber : prefixed_unit<zeptoweber, zepto, weber> {};
struct attoweber : prefixed_unit<attoweber, atto, weber> {};
struct femtoweber : prefixed_unit<femtoweber, femto, weber> {};
struct picoweber : prefixed_unit<picoweber, pico, weber> {};
struct nanoweber : prefixed_unit<nanoweber, nano, weber> {};
struct microweber : prefixed_unit<microweber, micro, weber> {};
struct milliweber : prefixed_unit<milliweber, milli, weber> {};
struct kiloweber : prefixed_unit<kiloweber, kilo, weber> {};
struct megaweber : prefixed_unit<megaweber, mega, weber> {};
struct gigaweber : prefixed_unit<gigaweber, giga, weber> {};
struct teraweber : prefixed_unit<teraweber, tera, weber> {};
struct petaweber : prefixed_unit<petaweber, peta, weber> {};
struct exaweber : prefixed_unit<exaweber, exa, weber> {};
struct zettaweber : prefixed_unit<zettaweber, zetta, weber> {};
struct yottaweber : prefixed_unit<yottaweber, yotta, weber> {};
struct dim_magnetic_flux : isq::dim_magnetic_flux<dim_magnetic_flux, weber, dim_magnetic_induction, dim_area> {};
template<UnitOf<dim_magnetic_flux> U, QuantityValue Rep = double>
using magnetic_flux = quantity<dim_magnetic_flux, U, Rep>;
inline namespace literals {
// Wb
constexpr auto operator"" _q_Wb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_flux<weber, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Wb(long double l) { return magnetic_flux<weber, long double>(l); }
// yWb
constexpr auto operator"" _q_yWb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_flux<yoctoweber, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yWb(long double l) { return magnetic_flux<yoctoweber, long double>(l); }
// zWb
constexpr auto operator"" _q_zWb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_flux<zeptoweber, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zWb(long double l) { return magnetic_flux<zeptoweber, long double>(l); }
// aWb
constexpr auto operator"" _q_aWb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_flux<attoweber, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aWb(long double l) { return magnetic_flux<attoweber, long double>(l); }
// fWb
constexpr auto operator"" _q_fWb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_flux<femtoweber, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fWb(long double l) { return magnetic_flux<femtoweber, long double>(l); }
// pWb
constexpr auto operator"" _q_pWb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_flux<picoweber, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pWb(long double l) { return magnetic_flux<picoweber, long double>(l); }
// nWb
constexpr auto operator"" _q_nWb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_flux<nanoweber, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nWb(long double l) { return magnetic_flux<nanoweber, long double>(l); }
// µWb
constexpr auto operator"" _q_uWb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_flux<microweber, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uWb(long double l) { return magnetic_flux<microweber, long double>(l); }
// mWb
constexpr auto operator"" _q_mWb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_flux<milliweber, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mWb(long double l) { return magnetic_flux<milliweber, long double>(l); }
// kWb
constexpr auto operator"" _q_kWb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_flux<kiloweber, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kWb(long double l) { return magnetic_flux<kiloweber, long double>(l); }
// MWb
constexpr auto operator"" _q_MWb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_flux<megaweber, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MWb(long double l) { return magnetic_flux<megaweber, long double>(l); }
// GWb
constexpr auto operator"" _q_GWb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_flux<gigaweber, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GWb(long double l) { return magnetic_flux<gigaweber, long double>(l); }
// TWb
constexpr auto operator"" _q_TWb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_flux<teraweber, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TWb(long double l) { return magnetic_flux<teraweber, long double>(l); }
// PWb
constexpr auto operator"" _q_PWb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_flux<petaweber, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PWb(long double l) { return magnetic_flux<petaweber, long double>(l); }
// EWb
constexpr auto operator"" _q_EWb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_flux<exaweber, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EWb(long double l) { return magnetic_flux<exaweber, long double>(l); }
// ZWb
constexpr auto operator"" _q_ZWb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_flux<zettaweber, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZWb(long double l) { return magnetic_flux<zettaweber, long double>(l); }
// YWb
constexpr auto operator"" _q_YWb(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_flux<yottaweber, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YWb(long double l) { return magnetic_flux<yottaweber, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,159 @@
// 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/isq/dimensions/magnetic_induction.h>
#include <units/isq/si/voltage.h>
#include <units/isq/si/time.h>
#include <units/isq/si/length.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct tesla : named_unit<tesla, "T", prefix> {};
struct yoctotesla : prefixed_unit<yoctotesla, yocto, tesla> {};
struct zeptotesla : prefixed_unit<zeptotesla, zepto, tesla> {};
struct attotesla : prefixed_unit<attotesla, atto, tesla> {};
struct femtotesla : prefixed_unit<femtotesla, femto, tesla> {};
struct picotesla : prefixed_unit<picotesla, pico, tesla> {};
struct nanotesla : prefixed_unit<nanotesla, nano, tesla> {};
struct microtesla : prefixed_unit<microtesla, micro, tesla> {};
struct millitesla : prefixed_unit<millitesla, milli, tesla> {};
struct kilotesla : prefixed_unit<kilotesla, kilo, tesla> {};
struct megatesla : prefixed_unit<megatesla, mega, tesla> {};
struct gigatesla : prefixed_unit<gigatesla, giga, tesla> {};
struct teratesla : prefixed_unit<teratesla, tera, tesla> {};
struct petatesla : prefixed_unit<petatesla, peta, tesla> {};
struct exatesla : prefixed_unit<exatesla, exa, tesla> {};
struct zettatesla : prefixed_unit<zettatesla, zetta, tesla> {};
struct yottatesla : prefixed_unit<yottatesla, yotta, tesla> {};
struct gauss : named_scaled_unit<gauss, "G", prefix, ratio(1, 10'000), tesla> {};
struct dim_magnetic_induction : isq::dim_magnetic_induction<dim_magnetic_induction, tesla, dim_voltage, dim_time, dim_length> {};
template<UnitOf<dim_magnetic_induction> U, QuantityValue Rep = double>
using magnetic_induction = quantity<dim_magnetic_induction, U, Rep>;
inline namespace literals {
// T
constexpr auto operator"" _q_T(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<tesla, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_T(long double l) { return magnetic_induction<tesla, long double>(l); }
// yT
constexpr auto operator"" _q_yT(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<yoctotesla, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yT(long double l) { return magnetic_induction<yoctotesla, long double>(l); }
// zT
constexpr auto operator"" _q_zT(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<zeptotesla, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zT(long double l) { return magnetic_induction<zeptotesla, long double>(l); }
// aT
constexpr auto operator"" _q_aT(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<attotesla, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aT(long double l) { return magnetic_induction<attotesla, long double>(l); }
// fT
constexpr auto operator"" _q_fT(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<femtotesla, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fT(long double l) { return magnetic_induction<femtotesla, long double>(l); }
// pT
constexpr auto operator"" _q_pT(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<picotesla, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pT(long double l) { return magnetic_induction<picotesla, long double>(l); }
// nT
constexpr auto operator"" _q_nT(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<nanotesla, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nT(long double l) { return magnetic_induction<nanotesla, long double>(l); }
// µT
constexpr auto operator"" _q_uT(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<microtesla, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uT(long double l) { return magnetic_induction<microtesla, long double>(l); }
// mT
constexpr auto operator"" _q_mT(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<millitesla, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mT(long double l) { return magnetic_induction<millitesla, long double>(l); }
// kT
constexpr auto operator"" _q_kT(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<kilotesla, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kT(long double l) { return magnetic_induction<kilotesla, long double>(l); }
// MT
constexpr auto operator"" _q_MT(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<megatesla, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MT(long double l) { return magnetic_induction<megatesla, long double>(l); }
// GT
constexpr auto operator"" _q_GT(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<gigatesla, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GT(long double l) { return magnetic_induction<gigatesla, long double>(l); }
// TT
constexpr auto operator"" _q_TT(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<teratesla, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TT(long double l) { return magnetic_induction<teratesla, long double>(l); }
// PT
constexpr auto operator"" _q_PT(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<petatesla, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PT(long double l) { return magnetic_induction<petatesla, long double>(l); }
// ET
constexpr auto operator"" _q_ET(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<exatesla, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ET(long double l) { return magnetic_induction<exatesla, long double>(l); }
// ZT
constexpr auto operator"" _q_ZT(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<zettatesla, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZT(long double l) { return magnetic_induction<zettatesla, long double>(l); }
// YT
constexpr auto operator"" _q_YT(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<yottatesla, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YT(long double l) { return magnetic_induction<yottatesla, long double>(l); }
// G
constexpr auto operator"" _q_G(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return magnetic_induction<gauss, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_G(long double l) { return magnetic_induction<gauss, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units
+307
View File
@@ -0,0 +1,307 @@
// 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/one_rep.h>
#include <units/isq/dimensions/mass.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct gram : named_unit<gram, "g", prefix> {};
struct yoctogram : prefixed_unit<yoctogram, yocto, gram> {};
struct zeptogram : prefixed_unit<zeptogram, zepto, gram> {};
struct attogram : prefixed_unit<attogram, atto, gram> {};
struct femtogram : prefixed_unit<femtogram, femto, gram> {};
struct picogram : prefixed_unit<picogram, pico, gram> {};
struct nanogram : prefixed_unit<nanogram, nano, gram> {};
struct microgram : prefixed_unit<microgram, micro, gram> {};
struct milligram : prefixed_unit<milligram, milli, gram> {};
struct centigram : prefixed_unit<centigram, centi, gram> {};
struct decigram : prefixed_unit<decigram, deci, gram> {};
struct decagram : prefixed_unit<decagram, deca, gram> {};
struct hectogram : prefixed_unit<hectogram, hecto, gram> {};
struct kilogram : prefixed_unit<kilogram, kilo, gram> {};
struct megagram : prefixed_unit<megagram, mega, gram> {};
struct gigagram : prefixed_unit<gigagram, giga, gram> {};
struct teragram : prefixed_unit<teragram, tera, gram> {};
struct petagram : prefixed_unit<petagram, peta, gram> {};
struct exagram : prefixed_unit<exagram, exa, gram> {};
struct zettagram : prefixed_unit<zettagram, zetta, gram> {};
struct yottagram : prefixed_unit<yottagram, yotta, gram> {};
struct tonne : alias_unit<megagram, "t", prefix> {};
struct yoctotonne : prefixed_alias_unit<attogram, yocto, tonne> {};
struct zeptotonne : prefixed_alias_unit<femtogram, zepto, tonne> {};
struct attotonne : prefixed_alias_unit<picogram, atto, tonne> {};
struct femtotonne : prefixed_alias_unit<nanogram, femto, tonne> {};
struct picotonne : prefixed_alias_unit<microgram, pico, tonne> {};
struct nanotonne : prefixed_alias_unit<milligram, nano, tonne> {};
struct microtonne : prefixed_alias_unit<gram, micro, tonne> {};
struct millitonne : prefixed_alias_unit<kilogram, milli, tonne> {};
struct centitonne : prefixed_unit<centitonne, centi, tonne> {};
struct decitonne : prefixed_unit<decitonne, deci, tonne> {};
struct decatonne : prefixed_unit<decatonne, deca, tonne> {};
struct hectotonne : prefixed_unit<hectotonne, hecto, tonne> {};
struct kilotonne : prefixed_alias_unit<gigagram, kilo, tonne> {};
struct megatonne : prefixed_alias_unit<teragram, mega, tonne> {};
struct gigatonne : prefixed_alias_unit<petagram, giga, tonne> {};
struct teratonne : prefixed_alias_unit<exagram, tera, tonne> {};
struct petatonne : prefixed_alias_unit<zettagram, peta, tonne> {};
struct exatonne : prefixed_alias_unit<yottagram, exa, tonne> {};
struct zettatonne : prefixed_unit<zettatonne, zetta, tonne> {};
struct yottatonne : prefixed_unit<yottatonne, yotta, tonne> {};
struct dalton : named_scaled_unit<dalton, "Da", no_prefix, ratio(16'605'390'666'050, 10'000'000'000'000, -27), kilogram> {};
struct dim_mass : isq::dim_mass<kilogram> {};
template<UnitOf<dim_mass> U, QuantityValue Rep = double>
using mass = quantity<dim_mass, U, Rep>;
inline namespace literals {
// g
constexpr auto operator"" _q_g(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<gram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_g(long double l) { return mass<gram, long double>(l); }
// yg
constexpr auto operator"" _q_yg(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<yoctogram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yg(long double l) { return mass<yoctogram, long double>(l); }
// zg
constexpr auto operator"" _q_zg(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<zeptogram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zg(long double l) { return mass<zeptogram, long double>(l); }
// ag
constexpr auto operator"" _q_ag(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<attogram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ag(long double l) { return mass<attogram, long double>(l); }
// fg
constexpr auto operator"" _q_fg(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<femtogram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fg(long double l) { return mass<femtogram, long double>(l); }
// pg
constexpr auto operator"" _q_pg(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<picogram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pg(long double l) { return mass<picogram, long double>(l); }
// ng
constexpr auto operator"" _q_ng(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<nanogram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ng(long double l) { return mass<nanogram, long double>(l); }
// ug
constexpr auto operator"" _q_ug(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<microgram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ug(long double l) { return mass<microgram, long double>(l); }
// mg
constexpr auto operator"" _q_mg(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<milligram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mg(long double l) { return mass<milligram, long double>(l); }
// cg
constexpr auto operator"" _q_cg(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<centigram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cg(long double l) { return mass<centigram, long double>(l); }
// dg
constexpr auto operator"" _q_dg(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<decigram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dg(long double l) { return mass<decigram, long double>(l); }
// dag
constexpr auto operator"" _q_dag(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<decagram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dag(long double l) { return mass<decagram, long double>(l); }
// hg
constexpr auto operator"" _q_hg(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<hectogram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hg(long double l) { return mass<hectogram, long double>(l); }
// kg
constexpr auto operator"" _q_kg(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<kilogram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kg(long double l) { return mass<kilogram, long double>(l); }
// Mg
constexpr auto operator"" _q_Mg(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<megagram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Mg(long double l) { return mass<megagram, long double>(l); }
// Gg
constexpr auto operator"" _q_Gg(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<gigagram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Gg(long double l) { return mass<gigagram, long double>(l); }
// Tg
constexpr auto operator"" _q_Tg(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<teragram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Tg(long double l) { return mass<teragram, long double>(l); }
// Pg
constexpr auto operator"" _q_Pg(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<petagram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Pg(long double l) { return mass<petagram, long double>(l); }
// Eg
constexpr auto operator"" _q_Eg(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<exagram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Eg(long double l) { return mass<exagram, long double>(l); }
// Zg
constexpr auto operator"" _q_Zg(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<zettagram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Zg(long double l) { return mass<zettagram, long double>(l); }
// Yg
constexpr auto operator"" _q_Yg(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<yottagram, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Yg(long double l) { return mass<yottagram, long double>(l); }
// t
constexpr auto operator"" _q_t(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<tonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_t(long double l) { return mass<tonne, long double>(l); }
// yt
constexpr auto operator"" _q_yt(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<yoctotonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yt(long double l) { return mass<yoctotonne, long double>(l); }
// zt
constexpr auto operator"" _q_zt(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<zeptotonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zt(long double l) { return mass<zeptotonne, long double>(l); }
// at
constexpr auto operator"" _q_at(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<attotonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_at(long double l) { return mass<attotonne, long double>(l); }
// ft
/*constexpr auto operator"" _q_ft(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<femtotonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ft(long double l) { return mass<femtotonne, long double>(l); }*/
// pt
constexpr auto operator"" _q_pt(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<picotonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pt(long double l) { return mass<picotonne, long double>(l); }
// nt
constexpr auto operator"" _q_nt(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<nanotonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nt(long double l) { return mass<nanotonne, long double>(l); }
// ut
constexpr auto operator"" _q_ut(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<microtonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ut(long double l) { return mass<microtonne, long double>(l); }
// mt
constexpr auto operator"" _q_mt(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<millitonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mt(long double l) { return mass<millitonne, long double>(l); }
// ct
constexpr auto operator"" _q_ct(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<centitonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ct(long double l) { return mass<centitonne, long double>(l); }
// dt
constexpr auto operator"" _q_dt(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<decitonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dt(long double l) { return mass<decitonne, long double>(l); }
// dat
constexpr auto operator"" _q_dat(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<decatonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dat(long double l) { return mass<decatonne, long double>(l); }
// ht
constexpr auto operator"" _q_ht(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<hectotonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ht(long double l) { return mass<hectotonne, long double>(l); }
// kt
constexpr auto operator"" _q_kt(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<kilotonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kt(long double l) { return mass<kilotonne, long double>(l); }
// Mt
constexpr auto operator"" _q_Mt(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<megatonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Mt(long double l) { return mass<megatonne, long double>(l); }
// Gt
constexpr auto operator"" _q_Gt(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<gigatonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Gt(long double l) { return mass<gigatonne, long double>(l); }
// Tt
constexpr auto operator"" _q_Tt(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<teratonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Tt(long double l) { return mass<teratonne, long double>(l); }
// Pt
constexpr auto operator"" _q_Pt(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<petatonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Pt(long double l) { return mass<petatonne, long double>(l); }
// Et
constexpr auto operator"" _q_Et(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<exatonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Et(long double l) { return mass<exatonne, long double>(l); }
// Zt
constexpr auto operator"" _q_Zt(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<zettatonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Zt(long double l) { return mass<zettatonne, long double>(l); }
// Yt
constexpr auto operator"" _q_Yt(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<yottatonne, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Yt(long double l) { return mass<yottatonne, long double>(l); }
// Da
constexpr auto operator"" _q_Da(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return mass<dalton, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Da(long double l) { return mass<dalton, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,48 @@
// The MIT License (MIT)
//
// Hopyright (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 SOHTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OH ANY KIND, EXPRESS OR
// IMPLIED, INHLUDING BUT NOT LIMITED TO THE WARRANTIES OH MERHHANTABILITY,
// HITNESS HOR A PARTIHULAR PURPOSE AND NONINHRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR HOPYRIGHT HOLDERS BE LIABLE HOR ANY HLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN AHTION OH HONTRAHT, TORT OR OTHERWISE, ARISING HROM,
// OUT OH OR IN HONNEHTION WITH THE SOHTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOHTWARE.
#pragma once
#include <units/isq/dimensions/molar_energy.h>
#include <units/isq/si/energy.h>
#include <units/isq/si/amount_of_substance.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct joule_per_mole : unit<joule_per_mole> {};
struct dim_molar_energy : isq::dim_molar_energy<dim_molar_energy, joule_per_mole, dim_energy, dim_amount_of_substance> {};
template<UnitOf<dim_molar_energy> U, QuantityValue Rep = double>
using molar_energy = quantity<dim_molar_energy, U, Rep>;
inline namespace literals {
// J/mol
constexpr auto operator"" _q_J_per_mol(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return molar_energy<joule_per_mole, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_J_per_mol(long double l) { return molar_energy<joule_per_mole, long double>(l); }
} // namespace literals
} // namespace units::isq::si
@@ -0,0 +1,46 @@
// 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/isq/dimensions/momentum.h>
#include <units/isq/si/mass.h>
#include <units/isq/si/speed.h>
#include <units/quantity.h>
namespace units::isq::si {
struct kilogram_metre_per_second : unit<kilogram_metre_per_second> {};
struct dim_momentum : isq::dim_momentum<dim_momentum, kilogram_metre_per_second, dim_mass, dim_speed> {};
template<UnitOf<dim_momentum> U, QuantityValue Rep = double>
using momentum = quantity<dim_momentum, U, Rep>;
inline namespace literals {
// kg*m/s
constexpr auto operator"" _q_kg_m_per_s(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return momentum<kilogram_metre_per_second, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kg_m_per_s(long double l) { return momentum<kilogram_metre_per_second, long double>(l); }
} // namespace literals
} // namespace units::isq::si
@@ -0,0 +1,48 @@
// The MIT License (MIT)
//
// Hopyright (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 SOHTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OH ANY KIND, EXPRESS OR
// IMPLIED, INHLUDING BUT NOT LIMITED TO THE WARRANTIES OH MERHHANTABILITY,
// HITNESS HOR A PARTIHULAR PURPOSE AND NONINHRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR HOPYRIGHT HOLDERS BE LIABLE HOR ANY HLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN AHTION OH HONTRAHT, TORT OR OTHERWISE, ARISING HROM,
// OUT OH OR IN HONNEHTION WITH THE SOHTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOHTWARE.
#pragma once
#include <units/isq/dimensions/permeability.h>
#include <units/isq/si/inductance.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct henry_per_metre : unit<henry_per_metre> {};
struct dim_permeability : isq::dim_permeability<dim_permeability, henry_per_metre, dim_inductance, dim_length> {};
template<UnitOf<dim_permeability> U, QuantityValue Rep = double>
using permeability = quantity<dim_permeability, U, Rep>;
inline namespace literals {
// H/m
constexpr auto operator"" _q_H_per_m(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return permeability<henry_per_metre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_H_per_m(long double l) { return permeability<henry_per_metre, long double>(l); }
} // namespace literals
} // namespace units::isq::si
@@ -0,0 +1,48 @@
// The MIT License (MIT)
//
// Fopyright (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, INFLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERFHANTABILITY,
// FITNESS FOR A PARTIFULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR FOPYRIGHT HOLDERS BE LIABLE FOR ANY FLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN AFTION OF FONTRAFT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN FONNEFTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#pragma once
#include <units/isq/dimensions/permittivity.h>
#include <units/isq/si/capacitance.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct farad_per_metre : unit<farad_per_metre> {};
struct dim_permittivity : isq::dim_permittivity<dim_permittivity, farad_per_metre, dim_capacitance, dim_length> {};
template<UnitOf<dim_permittivity> U, QuantityValue Rep = double>
using permittivity = quantity<dim_permittivity, U, Rep>;
inline namespace literals {
// F/m
constexpr auto operator"" _q_F_per_m(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return permittivity<farad_per_metre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_F_per_m(long double l) { return permittivity<farad_per_metre, long double>(l); }
} // namespace literals
} // namespace units::isq::si
+149
View File
@@ -0,0 +1,149 @@
// 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/isq/dimensions/power.h>
#include <units/isq/si/energy.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct watt : named_unit<watt, "W", prefix> {};
struct yoctowatt : prefixed_unit<yoctowatt, yocto, watt> {};
struct zeptowatt : prefixed_unit<zeptowatt, zepto, watt> {};
struct attowatt : prefixed_unit<attowatt, atto, watt> {};
struct femtowatt : prefixed_unit<femtowatt, femto, watt> {};
struct picowatt : prefixed_unit<picowatt, pico, watt> {};
struct nanowatt : prefixed_unit<nanowatt, nano, watt> {};
struct microwatt : prefixed_unit<microwatt, micro, watt> {};
struct milliwatt : prefixed_unit<milliwatt, milli, watt> {};
struct kilowatt : prefixed_unit<kilowatt, kilo, watt> {};
struct megawatt : prefixed_unit<megawatt, mega, watt> {};
struct gigawatt : prefixed_unit<gigawatt, giga, watt> {};
struct terawatt : prefixed_unit<terawatt, tera, watt> {};
struct petawatt : prefixed_unit<petawatt, peta, watt> {};
struct exawatt : prefixed_unit<exawatt, exa, watt> {};
struct zettawatt : prefixed_unit<zettawatt, zetta, watt> {};
struct yottawatt : prefixed_unit<yottawatt, yotta, watt> {};
struct dim_power : isq::dim_power<dim_power, watt, dim_energy, dim_time> {};
template<UnitOf<dim_power> U, QuantityValue Rep = double>
using power = quantity<dim_power, U, Rep>;
inline namespace literals {
// W
constexpr auto operator"" _q_W(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<watt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_W(long double l) { return power<watt, long double>(l); }
// yW
constexpr auto operator"" _q_yW(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<yoctowatt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yW(long double l) { return power<yoctowatt, long double>(l); }
// zW
constexpr auto operator"" _q_zW(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<zeptowatt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zW(long double l) { return power<zeptowatt, long double>(l); }
// aW
constexpr auto operator"" _q_aW(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<attowatt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aW(long double l) { return power<attowatt, long double>(l); }
// fW
constexpr auto operator"" _q_fW(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<femtowatt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fW(long double l) { return power<femtowatt, long double>(l); }
// pW
constexpr auto operator"" _q_pW(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<picowatt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pW(long double l) { return power<picowatt, long double>(l); }
// nW
constexpr auto operator"" _q_nW(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<nanowatt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nW(long double l) { return power<nanowatt, long double>(l); }
// uW
constexpr auto operator"" _q_uW(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<microwatt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uW(long double l) { return power<microwatt, long double>(l); }
// mW
constexpr auto operator"" _q_mW(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<milliwatt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mW(long double l) { return power<milliwatt, long double>(l); }
// kW
constexpr auto operator"" _q_kW(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<kilowatt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kW(long double l) { return power<kilowatt, long double>(l); }
// MW
constexpr auto operator"" _q_MW(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<megawatt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MW(long double l) { return power<megawatt, long double>(l); }
// GW
constexpr auto operator"" _q_GW(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<gigawatt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GW(long double l) { return power<gigawatt, long double>(l); }
// TW
constexpr auto operator"" _q_TW(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<terawatt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TW(long double l) { return power<terawatt, long double>(l); }
// PW
constexpr auto operator"" _q_PW(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<petawatt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PW(long double l) { return power<petawatt, long double>(l); }
// EW
constexpr auto operator"" _q_EW(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<exawatt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EW(long double l) { return power<exawatt, long double>(l); }
// ZW
constexpr auto operator"" _q_ZW(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<zettawatt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZW(long double l) { return power<zettawatt, long double>(l); }
// YW
constexpr auto operator"" _q_YW(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return power<yottawatt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YW(long double l) { return power<yottawatt, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,54 @@
// 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/prefix.h>
namespace units::isq::si {
struct prefix : prefix_family {};
// clang-format off
struct yocto : units::prefix<yocto, prefix, "y", ratio(1, 1, -24)> {};
struct zepto : units::prefix<zepto, prefix, "z", ratio(1, 1, -21)> {};
struct atto : units::prefix<atto, prefix, "a", ratio(1, 1, -18)> {};
struct femto : units::prefix<femto, prefix, "f", ratio(1, 1, -15)> {};
struct pico : units::prefix<pico, prefix, "p", ratio(1, 1, -12)> {};
struct nano : units::prefix<nano, prefix, "n", ratio(1, 1, -9)> {};
struct micro : units::prefix<micro, prefix, basic_symbol_text{"\u00b5", "u"}, ratio(1, 1, -6)> {};
struct milli : units::prefix<milli, prefix, "m", ratio(1, 1, -3)> {};
struct centi : units::prefix<centi, prefix, "c", ratio(1, 1, -2)> {};
struct deci : units::prefix<deci, prefix, "d", ratio(1, 1, -1)> {};
struct deca : units::prefix<deca, prefix, "da", ratio(1, 1, 1)> {};
struct hecto : units::prefix<hecto, prefix, "h", ratio(1, 1, 2)> {};
struct kilo : units::prefix<kilo, prefix, "k", ratio(1, 1, 3)> {};
struct mega : units::prefix<mega, prefix, "M", ratio(1, 1, 6)> {};
struct giga : units::prefix<giga, prefix, "G", ratio(1, 1, 9)> {};
struct tera : units::prefix<tera, prefix, "T", ratio(1, 1, 12)> {};
struct peta : units::prefix<peta, prefix, "P", ratio(1, 1, 15)> {};
struct exa : units::prefix<exa, prefix, "E", ratio(1, 1, 18)> {};
struct zetta : units::prefix<zetta, prefix, "Z", ratio(1, 1, 21)> {};
struct yotta : units::prefix<yotta, prefix, "Y", ratio(1, 1, 24)> {};
// clang-format on
} // namespace units::isq::si
@@ -0,0 +1,174 @@
// 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/isq/dimensions/pressure.h>
#include <units/isq/si/area.h>
#include <units/isq/si/force.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct pascal : named_unit<pascal, "Pa", prefix> {};
struct yoctopascal : prefixed_unit<yoctopascal, yocto, pascal> {};
struct zeptopascal : prefixed_unit<zeptopascal, zepto, pascal> {};
struct attopascal : prefixed_unit<attopascal, atto, pascal> {};
struct femtopascal : prefixed_unit<femtopascal, femto, pascal> {};
struct picopascal : prefixed_unit<picopascal, pico, pascal> {};
struct nanopascal : prefixed_unit<nanopascal, nano, pascal> {};
struct micropascal : prefixed_unit<micropascal, micro, pascal> {};
struct millipascal : prefixed_unit<millipascal, milli, pascal> {};
struct centipascal : prefixed_unit<centipascal, centi, pascal> {};
struct decipascal : prefixed_unit<decipascal, deci, pascal> {};
struct decapascal : prefixed_unit<decapascal, deca, pascal> {};
struct hectopascal : prefixed_unit<hectopascal, hecto, pascal> {};
struct kilopascal : prefixed_unit<kilopascal, kilo, pascal> {};
struct megapascal : prefixed_unit<megapascal, mega, pascal> {};
struct gigapascal : prefixed_unit<gigapascal, giga, pascal> {};
struct terapascal : prefixed_unit<terapascal, tera, pascal> {};
struct petapascal : prefixed_unit<petapascal, peta, pascal> {};
struct exapascal : prefixed_unit<exapascal, exa, pascal> {};
struct zettapascal : prefixed_unit<zettapascal, zetta, pascal> {};
struct yottapascal : prefixed_unit<yottapascal, yotta, pascal> {};
struct dim_pressure : isq::dim_pressure<dim_pressure, pascal, dim_force, dim_area> {};
template<UnitOf<dim_pressure> U, QuantityValue Rep = double>
using pressure = quantity<dim_pressure, U, Rep>;
inline namespace literals {
// Pa
constexpr auto operator"" _q_Pa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<pascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Pa(long double l) { return pressure<pascal, long double>(l); }
// yPa
constexpr auto operator"" _q_yPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<yoctopascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yPa(long double l) { return pressure<yoctopascal, long double>(l); }
// zPa
constexpr auto operator"" _q_zPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<zeptopascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zPa(long double l) { return pressure<zeptopascal, long double>(l); }
// aPa
constexpr auto operator"" _q_aPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<attopascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aPa(long double l) { return pressure<attopascal, long double>(l); }
// fPa
constexpr auto operator"" _q_fPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<femtopascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fPa(long double l) { return pressure<femtopascal, long double>(l); }
// pPa
constexpr auto operator"" _q_pPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<picopascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pPa(long double l) { return pressure<picopascal, long double>(l); }
// nPa
constexpr auto operator"" _q_nPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<nanopascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nPa(long double l) { return pressure<nanopascal, long double>(l); }
// uPa
constexpr auto operator"" _q_uPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<micropascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uPa(long double l) { return pressure<micropascal, long double>(l); }
// mPa
constexpr auto operator"" _q_mPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<millipascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mPa(long double l) { return pressure<millipascal, long double>(l); }
// cPa
constexpr auto operator"" _q_cPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<centipascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cPa(long double l) { return pressure<centipascal, long double>(l); }
// dPa
constexpr auto operator"" _q_dPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<decipascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dPa(long double l) { return pressure<decipascal, long double>(l); }
// daPa
constexpr auto operator"" _q_daPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<decapascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_daPa(long double l) { return pressure<decapascal, long double>(l); }
// hPa
constexpr auto operator"" _q_hPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<hectopascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hPa(long double l) { return pressure<hectopascal, long double>(l); }
// kPa
constexpr auto operator"" _q_kPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<kilopascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kPa(long double l) { return pressure<kilopascal, long double>(l); }
// MPa
constexpr auto operator"" _q_MPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<megapascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MPa(long double l) { return pressure<megapascal, long double>(l); }
// GPa
constexpr auto operator"" _q_GPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<gigapascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GPa(long double l) { return pressure<gigapascal, long double>(l); }
// TPa
constexpr auto operator"" _q_TPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<terapascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TPa(long double l) { return pressure<terapascal, long double>(l); }
// PPa
constexpr auto operator"" _q_PPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<petapascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PPa(long double l) { return pressure<petapascal, long double>(l); }
// EPa
constexpr auto operator"" _q_EPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<exapascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EPa(long double l) { return pressure<exapascal, long double>(l); }
// ZPa
constexpr auto operator"" _q_ZPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<zettapascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZPa(long double l) { return pressure<zettapascal, long double>(l); }
// YPa
constexpr auto operator"" _q_YPa(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return pressure<yottapascal, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YPa(long double l) { return pressure<yottapascal, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,172 @@
// 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/isq/dimensions/radioactivity.h>
#include <units/isq/si/time.h>
#include <units/quantity.h>
namespace units::isq::si {
struct becquerel : named_unit<becquerel, "Bq", prefix> {};
struct yoctobecquerel : prefixed_unit<yoctobecquerel, yocto, becquerel> {};
struct zeptobecquerel : prefixed_unit<zeptobecquerel, zepto, becquerel> {};
struct attobecquerel : prefixed_unit<attobecquerel, atto, becquerel> {};
struct femtobecquerel : prefixed_unit<femtobecquerel, femto, becquerel> {};
struct picobecquerel : prefixed_unit<picobecquerel, pico, becquerel> {};
struct nanobecquerel : prefixed_unit<nanobecquerel, nano, becquerel> {};
struct microbecquerel : prefixed_unit<microbecquerel, micro, becquerel> {};
struct millibecquerel : prefixed_unit<millibecquerel, milli, becquerel> {};
struct centibecquerel : prefixed_unit<centibecquerel, centi, becquerel> {};
struct decibecquerel : prefixed_unit<decibecquerel, deci, becquerel> {};
struct decabecquerel : prefixed_unit<decabecquerel, deca, becquerel> {};
struct hectobecquerel : prefixed_unit<hectobecquerel, hecto, becquerel> {};
struct kilobecquerel : prefixed_unit<kilobecquerel, kilo, becquerel> {};
struct megabecquerel : prefixed_unit<megabecquerel, mega, becquerel> {};
struct gigabecquerel : prefixed_unit<gigabecquerel, giga, becquerel> {};
struct terabecquerel : prefixed_unit<terabecquerel, tera, becquerel> {};
struct petabecquerel : prefixed_unit<petabecquerel, peta, becquerel> {};
struct exabecquerel : prefixed_unit<exabecquerel, exa, becquerel> {};
struct zettabecquerel : prefixed_unit<zettabecquerel, zetta, becquerel> {};
struct yottabecquerel : prefixed_unit<yottabecquerel, yotta, becquerel> {};
struct dim_radioactivity : isq::dim_radioactivity<dim_radioactivity, becquerel, dim_time> {};
template<UnitOf<dim_radioactivity> U, QuantityValue Rep = double>
using radioactivity = quantity<dim_radioactivity, U, Rep>;
inline namespace literals {
// Bq
constexpr auto operator"" _q_Bq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<becquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Bq(long double l) { return radioactivity<becquerel, long double>(l); }
// yBq
constexpr auto operator"" _q_yBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<yoctobecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yBq(long double l) { return radioactivity<yoctobecquerel, long double>(l); }
// zBq
constexpr auto operator"" _q_zBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<zeptobecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zBq(long double l) { return radioactivity<zeptobecquerel, long double>(l); }
// aBq
constexpr auto operator"" _q_aBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<attobecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aBq(long double l) { return radioactivity<attobecquerel, long double>(l); }
// fBq
constexpr auto operator"" _q_fBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<femtobecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fBq(long double l) { return radioactivity<femtobecquerel, long double>(l); }
// pBq
constexpr auto operator"" _q_pBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<picobecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pBq(long double l) { return radioactivity<picobecquerel, long double>(l); }
// nBq
constexpr auto operator"" _q_nBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<nanobecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nBq(long double l) { return radioactivity<nanobecquerel, long double>(l); }
// uBq
constexpr auto operator"" _q_uBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<microbecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uBq(long double l) { return radioactivity<microbecquerel, long double>(l); }
// mBq
constexpr auto operator"" _q_mBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<millibecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mBq(long double l) { return radioactivity<millibecquerel, long double>(l); }
// cBq
constexpr auto operator"" _q_cBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<centibecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cBq(long double l) { return radioactivity<centibecquerel, long double>(l); }
// dBq
constexpr auto operator"" _q_dBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<decibecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dBq(long double l) { return radioactivity<decibecquerel, long double>(l); }
// daBq
constexpr auto operator"" _q_daBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<decabecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_daBq(long double l) { return radioactivity<decabecquerel, long double>(l); }
// hBq
constexpr auto operator"" _q_hBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<hectobecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hBq(long double l) { return radioactivity<hectobecquerel, long double>(l); }
// kBq
constexpr auto operator"" _q_kBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<kilobecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kBq(long double l) { return radioactivity<kilobecquerel, long double>(l); }
// MBq
constexpr auto operator"" _q_MBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<megabecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MBq(long double l) { return radioactivity<megabecquerel, long double>(l); }
// GBq
constexpr auto operator"" _q_GBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<gigabecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GBq(long double l) { return radioactivity<gigabecquerel, long double>(l); }
// TBq
constexpr auto operator"" _q_TBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<terabecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TBq(long double l) { return radioactivity<terabecquerel, long double>(l); }
// PBq
constexpr auto operator"" _q_PBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<petabecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PBq(long double l) { return radioactivity<petabecquerel, long double>(l); }
// EBq
constexpr auto operator"" _q_EBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<exabecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EBq(long double l) { return radioactivity<exabecquerel, long double>(l); }
// ZBq
constexpr auto operator"" _q_ZBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<zettabecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZBq(long double l) { return radioactivity<zettabecquerel, long double>(l); }
// YBq
constexpr auto operator"" _q_YBq(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return radioactivity<yottabecquerel, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YBq(long double l) { return radioactivity<yottabecquerel, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,150 @@
// 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/isq/dimensions/resistance.h>
#include <units/isq/si/voltage.h>
#include <units/isq/si/electric_current.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct ohm : named_unit<ohm, basic_symbol_text{"Ω", "ohm"}, prefix> {};
struct yoctoohm : prefixed_unit<yoctoohm, yocto, ohm> {};
struct zeptoohm : prefixed_unit<zeptoohm, zepto, ohm> {};
struct attoohm : prefixed_unit<attoohm, atto, ohm> {};
struct femtoohm : prefixed_unit<femtoohm, femto, ohm> {};
struct picoohm : prefixed_unit<picoohm, pico, ohm> {};
struct nanoohm : prefixed_unit<nanoohm, nano, ohm> {};
struct microohm : prefixed_unit<microohm, micro, ohm> {};
struct milliohm : prefixed_unit<milliohm, milli, ohm> {};
struct kiloohm : prefixed_unit<kiloohm, kilo, ohm> {};
struct megaohm : prefixed_unit<megaohm, mega, ohm> {};
struct gigaohm : prefixed_unit<gigaohm, giga, ohm> {};
struct teraohm : prefixed_unit<teraohm, tera, ohm> {};
struct petaohm : prefixed_unit<petaohm, peta, ohm> {};
struct exaohm : prefixed_unit<exaohm, exa, ohm> {};
struct zettaohm : prefixed_unit<zettaohm, zetta, ohm> {};
struct yottaohm : prefixed_unit<yottaohm, yotta, ohm> {};
struct dim_resistance : isq::dim_resistance<dim_resistance, ohm, dim_voltage, dim_electric_current> {};
template<UnitOf<dim_resistance> U, QuantityValue Rep = double>
using resistance = quantity<dim_resistance, U, Rep>;
inline namespace literals {
// R
constexpr auto operator"" _q_R(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return resistance<ohm, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_R(long double l) { return resistance<ohm, long double>(l); }
// yR
constexpr auto operator"" _q_yR(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return resistance<yoctoohm, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yR(long double l) { return resistance<yoctoohm, long double>(l); }
// zR
constexpr auto operator"" _q_zR(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return resistance<zeptoohm, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zR(long double l) { return resistance<zeptoohm, long double>(l); }
// aR
constexpr auto operator"" _q_aR(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return resistance<attoohm, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aR(long double l) { return resistance<attoohm, long double>(l); }
// fR
constexpr auto operator"" _q_fR(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return resistance<femtoohm, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fR(long double l) { return resistance<femtoohm, long double>(l); }
// pR
constexpr auto operator"" _q_pR(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return resistance<picoohm, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pR(long double l) { return resistance<picoohm, long double>(l); }
// nR
constexpr auto operator"" _q_nR(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return resistance<nanoohm, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nR(long double l) { return resistance<nanoohm, long double>(l); }
// uR
constexpr auto operator"" _q_uR(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return resistance<microohm, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uR(long double l) { return resistance<microohm, long double>(l); }
// mR
constexpr auto operator"" _q_mR(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return resistance<milliohm, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mR(long double l) { return resistance<milliohm, long double>(l); }
// kR
constexpr auto operator"" _q_kR(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return resistance<kiloohm, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kR(long double l) { return resistance<kiloohm, long double>(l); }
// MR
constexpr auto operator"" _q_MR(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return resistance<megaohm, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MR(long double l) { return resistance<megaohm, long double>(l); }
// GR
constexpr auto operator"" _q_GR(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return resistance<gigaohm, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GR(long double l) { return resistance<gigaohm, long double>(l); }
// TR
constexpr auto operator"" _q_TR(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return resistance<teraohm, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TR(long double l) { return resistance<teraohm, long double>(l); }
// PR
constexpr auto operator"" _q_PR(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return resistance<petaohm, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PR(long double l) { return resistance<petaohm, long double>(l); }
// ER
constexpr auto operator"" _q_ER(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return resistance<exaohm, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ER(long double l) { return resistance<exaohm, long double>(l); }
// ZR
constexpr auto operator"" _q_ZR(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return resistance<zettaohm, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZR(long double l) { return resistance<zettaohm, long double>(l); }
// YR
constexpr auto operator"" _q_YR(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return resistance<yottaohm, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YR(long double l) { return resistance<yottaohm, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
+74
View File
@@ -0,0 +1,74 @@
// 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/isq/si/electric_current.h>
#include <units/isq/si/length.h>
#include <units/isq/si/luminous_intensity.h>
#include <units/isq/si/mass.h>
#include <units/isq/si/amount_of_substance.h>
#include <units/isq/si/thermodynamic_temperature.h>
#include <units/isq/si/time.h>
#include <units/isq/si/absorbed_dose.h>
#include <units/isq/si/acceleration.h>
#include <units/isq/si/angular_velocity.h>
#include <units/isq/si/area.h>
#include <units/isq/si/capacitance.h>
#include <units/isq/si/catalytic_activity.h>
#include <units/isq/si/charge_density.h>
#include <units/isq/si/concentration.h>
#include <units/isq/si/conductance.h>
#include <units/isq/si/current_density.h>
#include <units/isq/si/density.h>
#include <units/isq/si/dynamic_viscosity.h>
#include <units/isq/si/electric_charge.h>
#include <units/isq/si/electric_field_strength.h>
#include <units/isq/si/energy.h>
// TODO Add when downcasting issue is solved (collides with pressure)
// #include <units/isq/si/energy_density.h>
#include <units/isq/si/force.h>
#include <units/isq/si/frequency.h>
#include <units/isq/si/heat_capacity.h>
#include <units/isq/si/inductance.h>
#include <units/isq/si/luminance.h>
#include <units/isq/si/magnetic_flux.h>
#include <units/isq/si/magnetic_induction.h>
#include <units/isq/si/molar_energy.h>
#include <units/isq/si/momentum.h>
#include <units/isq/si/permeability.h>
#include <units/isq/si/permittivity.h>
#include <units/isq/si/power.h>
#include <units/isq/si/pressure.h>
// TODO Add when downcasting issue is solved (collides with frequency)
// #include <units/isq/si/radioactivity.h>
#include <units/isq/si/resistance.h>
#include <units/isq/si/speed.h>
#include <units/isq/si/surface_tension.h>
#include <units/isq/si/thermal_conductivity.h>
#include <units/isq/si/torque.h>
#include <units/isq/si/voltage.h>
#include <units/isq/si/volume.h>
#include <units/isq/si/constants.h>
#include <units/isq/si/prefixes.h>
@@ -0,0 +1,52 @@
// 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/isq/dimensions/speed.h>
#include <units/isq/si/length.h>
#include <units/isq/si/time.h>
#include <units/quantity.h>
namespace units::isq::si {
struct metre_per_second : unit<metre_per_second> {};
struct dim_speed : isq::dim_speed<dim_speed, metre_per_second, dim_length, dim_time> {};
struct kilometre_per_hour : deduced_unit<kilometre_per_hour, dim_speed, kilometre, hour> {};
template<UnitOf<dim_speed> U, QuantityValue Rep = double>
using speed = quantity<dim_speed, U, Rep>;
inline namespace literals {
// m/s
constexpr auto operator"" _q_m_per_s(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return speed<metre_per_second, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_m_per_s(long double l) { return speed<metre_per_second, long double>(l); }
// km/h
constexpr auto operator"" _q_km_per_h(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return speed<kilometre_per_hour, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_km_per_h(long double l) { return speed<kilometre_per_hour, long double>(l); }
} // namespace literals
} // namespace units::isq::si
@@ -0,0 +1,46 @@
// 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/isq/dimensions/surface_tension.h>
#include <units/isq/si/force.h>
#include <units/quantity.h>
namespace units::isq::si {
struct newton_per_metre : unit<newton_per_metre> {};
struct dim_surface_tension : isq::dim_surface_tension<dim_surface_tension, newton_per_metre, dim_force, dim_length> {};
template<UnitOf<dim_surface_tension> U, QuantityValue Rep = double>
using surface_tension = quantity<dim_surface_tension, U, Rep>;
inline namespace literals {
// N/m
constexpr auto operator"" _q_N_per_m(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return surface_tension<newton_per_metre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_N_per_m(long double l) { return surface_tension<newton_per_metre, long double>(l); }
} // namespace literals
} // namespace units::isq::si
@@ -0,0 +1,47 @@
// 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/isq/dimensions/thermal_conductivity.h>
#include <units/isq/si/power.h>
#include <units/isq/si/thermodynamic_temperature.h>
#include <units/quantity.h>
namespace units::isq::si {
struct watt_per_metre_kelvin : unit<watt_per_metre_kelvin> {};
struct dim_thermal_conductivity : isq::dim_thermal_conductivity<dim_thermal_conductivity, watt_per_metre_kelvin, dim_power, dim_length, dim_thermodynamic_temperature> {};
template<UnitOf<dim_thermal_conductivity> U, QuantityValue Rep = double>
using thermal_conductivity = quantity<dim_thermal_conductivity, U, Rep>;
inline namespace literals {
// W/(m K)
constexpr auto operator"" _q_W_per_m_K(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return thermal_conductivity<watt_per_metre_kelvin, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_W_per_m_K(long double l) { return thermal_conductivity<watt_per_metre_kelvin, long double>(l); }
} // namespace literals
} // namespace units::isq::si
@@ -0,0 +1,52 @@
// 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/one_rep.h>
#include <units/isq/dimensions/thermodynamic_temperature.h>
#include <units/quantity.h>
namespace units::isq::si {
struct kelvin : named_unit<kelvin, "K", no_prefix> {};
struct dim_thermodynamic_temperature : isq::dim_thermodynamic_temperature<kelvin> {};
template<UnitOf<dim_thermodynamic_temperature> U, QuantityValue Rep = double>
using thermodynamic_temperature = quantity<dim_thermodynamic_temperature, U, Rep>;
inline namespace literals {
// K
constexpr auto operator"" _q_K(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return thermodynamic_temperature<kelvin, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_K(long double l) { return thermodynamic_temperature<kelvin, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto K = thermodynamic_temperature<kelvin, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si
+119
View File
@@ -0,0 +1,119 @@
// 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/one_rep.h>
#include <units/isq/dimensions/time.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct second : named_unit<second, "s", prefix> {};
struct yoctosecond : prefixed_unit<yoctosecond, yocto, second> {};
struct zeptosecond : prefixed_unit<zeptosecond, zepto, second> {};
struct attosecond : prefixed_unit<attosecond, atto, second> {};
struct femtosecond : prefixed_unit<femtosecond, femto, second> {};
struct picosecond : prefixed_unit<picosecond, pico, second> {};
struct nanosecond : prefixed_unit<nanosecond, nano, second> {};
struct microsecond : prefixed_unit<microsecond, micro, second> {};
struct millisecond : prefixed_unit<millisecond, milli, second> {};
struct minute : named_scaled_unit<minute, "min", no_prefix, ratio(60), second> {};
struct hour : named_scaled_unit<hour, "h", no_prefix, ratio(60), minute> {};
struct day : named_scaled_unit<day, "d", no_prefix, ratio(24), hour> {};
struct dim_time : isq::dim_time<second> {};
template<UnitOf<dim_time> U, QuantityValue Rep = double>
using time = quantity<dim_time, U, Rep>;
inline namespace literals {
// ys
constexpr auto operator"" _q_ys(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return time<yoctosecond, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ys(long double l) { return time<yoctosecond, long double>(l); }
// zs
constexpr auto operator"" _q_zs(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return time<zeptosecond, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zs(long double l) { return time<zeptosecond, long double>(l); }
// as
constexpr auto operator"" _q_as(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return time<attosecond, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_as(long double l) { return time<attosecond, long double>(l); }
// fs
constexpr auto operator"" _q_fs(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return time<femtosecond, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fs(long double l) { return time<femtosecond, long double>(l); }
// ps
constexpr auto operator"" _q_ps(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return time<picosecond, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ps(long double l) { return time<picosecond, long double>(l); }
// ns
constexpr auto operator"" _q_ns(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return time<nanosecond, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ns(long double l) { return time<nanosecond, long double>(l); }
// us
constexpr auto operator"" _q_us(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return time<microsecond, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_us(long double l) { return time<microsecond, long double>(l); }
// ms
constexpr auto operator"" _q_ms(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return time<millisecond, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ms(long double l) { return time<millisecond, long double>(l); }
// s
constexpr auto operator"" _q_s(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return time<second, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_s(long double l) { return time<second, long double>(l); }
// min
constexpr auto operator"" _q_min(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return time<minute, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_min(long double l) { return time<minute, long double>(l); }
// h
constexpr auto operator"" _q_h(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return time<hour, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_h(long double l) { return time<hour, long double>(l); }
// d
constexpr auto operator"" _q_d(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return time<day, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_d(long double l) { return time<day, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,54 @@
// 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/isq/dimensions/torque.h>
#include <units/isq/si/energy.h>
#include <units/generic/angle.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct newton_metre_per_radian : unit<newton_metre_per_radian> {};
struct dim_torque : isq::dim_torque<dim_torque, newton_metre_per_radian, dim_force, dim_length, dim_angle<>> {};
template<UnitOf<dim_torque> U, QuantityValue Rep = double>
using torque = quantity<dim_torque, U, Rep>;
inline namespace literals {
// Nm
constexpr auto operator"" _q_Nm_per_rad(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return torque<newton_metre_per_radian, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Nm_per_rad(long double l) { return torque<newton_metre_per_radian, long double>(l); }
} // namespace literals
namespace unit_constants {
inline constexpr auto Nm_per_rad = torque<newton_metre_per_radian, one_rep>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,174 @@
// 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/isq/dimensions/voltage.h>
#include <units/isq/si/electric_current.h>
#include <units/isq/si/power.h>
#include <units/isq/si/prefixes.h>
#include <units/quantity.h>
namespace units::isq::si {
struct volt : named_unit<volt, "V", prefix> {};
struct yoctovolt : prefixed_unit<yoctovolt, yocto, volt> {};
struct zeptovolt : prefixed_unit<zeptovolt, zepto, volt> {};
struct attovolt : prefixed_unit<attovolt, atto, volt> {};
struct femtovolt : prefixed_unit<femtovolt, femto, volt> {};
struct picovolt : prefixed_unit<picovolt, pico, volt> {};
struct nanovolt : prefixed_unit<nanovolt, nano, volt> {};
struct microvolt : prefixed_unit<microvolt, micro, volt> {};
struct millivolt : prefixed_unit<millivolt, milli, volt> {};
struct centivolt : prefixed_unit<centivolt, centi, volt> {};
struct decivolt : prefixed_unit<decivolt, deci, volt> {};
struct decavolt : prefixed_unit<decavolt, deca, volt> {};
struct hectovolt : prefixed_unit<hectovolt, hecto, volt> {};
struct kilovolt : prefixed_unit<kilovolt, kilo, volt> {};
struct megavolt : prefixed_unit<megavolt, mega, volt> {};
struct gigavolt : prefixed_unit<gigavolt, giga, volt> {};
struct teravolt : prefixed_unit<teravolt, tera, volt> {};
struct petavolt : prefixed_unit<petavolt, peta, volt> {};
struct exavolt : prefixed_unit<exavolt, exa, volt> {};
struct zettavolt : prefixed_unit<zettavolt, zetta, volt> {};
struct yottavolt : prefixed_unit<yottavolt, yotta, volt> {};
struct dim_voltage : isq::dim_voltage<dim_voltage, volt, dim_power, dim_electric_current> {};
template<UnitOf<dim_voltage> U, QuantityValue Rep = double>
using voltage = quantity<dim_voltage, U, Rep>;
inline namespace literals {
// V
constexpr auto operator"" _q_V(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<volt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_V(long double l) { return voltage<volt, long double>(l); }
// yV
constexpr auto operator"" _q_yV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<yoctovolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yV(long double l) { return voltage<yoctovolt, long double>(l); }
// zV
constexpr auto operator"" _q_zV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<zeptovolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zV(long double l) { return voltage<zeptovolt, long double>(l); }
// aV
constexpr auto operator"" _q_aV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<attovolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_aV(long double l) { return voltage<attovolt, long double>(l); }
// fV
constexpr auto operator"" _q_fV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<femtovolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fV(long double l) { return voltage<femtovolt, long double>(l); }
// pV
constexpr auto operator"" _q_pV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<picovolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pV(long double l) { return voltage<picovolt, long double>(l); }
// nV
constexpr auto operator"" _q_nV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<nanovolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nV(long double l) { return voltage<nanovolt, long double>(l); }
// uV
constexpr auto operator"" _q_uV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<microvolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_uV(long double l) { return voltage<microvolt, long double>(l); }
// mV
constexpr auto operator"" _q_mV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<millivolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mV(long double l) { return voltage<millivolt, long double>(l); }
// cV
constexpr auto operator"" _q_cV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<centivolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cV(long double l) { return voltage<centivolt, long double>(l); }
// dV
constexpr auto operator"" _q_dV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<decivolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dV(long double l) { return voltage<decivolt, long double>(l); }
// daV
constexpr auto operator"" _q_daV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<decavolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_daV(long double l) { return voltage<decavolt, long double>(l); }
// hV
constexpr auto operator"" _q_hV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<hectovolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hV(long double l) { return voltage<hectovolt, long double>(l); }
// kV
constexpr auto operator"" _q_kV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<kilovolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kV(long double l) { return voltage<kilovolt, long double>(l); }
// MV
constexpr auto operator"" _q_MV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<megavolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_MV(long double l) { return voltage<megavolt, long double>(l); }
// GV
constexpr auto operator"" _q_GV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<gigavolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_GV(long double l) { return voltage<gigavolt, long double>(l); }
// TV
constexpr auto operator"" _q_TV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<teravolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_TV(long double l) { return voltage<teravolt, long double>(l); }
// PV
constexpr auto operator"" _q_PV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<petavolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_PV(long double l) { return voltage<petavolt, long double>(l); }
// EV
constexpr auto operator"" _q_EV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<exavolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_EV(long double l) { return voltage<exavolt, long double>(l); }
// ZV
constexpr auto operator"" _q_ZV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<zettavolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ZV(long double l) { return voltage<zettavolt, long double>(l); }
// YV
constexpr auto operator"" _q_YV(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return voltage<yottavolt, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_YV(long double l) { return voltage<yottavolt, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si
@@ -0,0 +1,299 @@
// 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/isq/dimensions/volume.h>
#include <units/isq/si/length.h>
#include <units/quantity.h>
namespace units::isq::si {
struct cubic_metre : unit<cubic_metre> {};
struct dim_volume : isq::dim_volume<dim_volume, cubic_metre, dim_length> {};
struct cubic_yoctometre : deduced_unit<cubic_yoctometre, dim_volume, yoctometre> {};
struct cubic_zeptometre : deduced_unit<cubic_zeptometre, dim_volume, zeptometre> {};
struct cubic_attometre : deduced_unit<cubic_attometre, dim_volume, attometre> {};
struct cubic_femtometre : deduced_unit<cubic_femtometre, dim_volume, femtometre> {};
struct cubic_picometre : deduced_unit<cubic_picometre, dim_volume, picometre> {};
struct cubic_nanometre : deduced_unit<cubic_nanometre, dim_volume, nanometre> {};
struct cubic_micrometre : deduced_unit<cubic_micrometre, dim_volume, micrometre> {};
struct cubic_millimetre : deduced_unit<cubic_millimetre, dim_volume, millimetre> {};
struct cubic_centimetre : deduced_unit<cubic_centimetre, dim_volume, centimetre> {};
struct cubic_decimetre : deduced_unit<cubic_decimetre, dim_volume, decimetre> {};
struct cubic_decametre : deduced_unit<cubic_decametre, dim_volume, decametre> {};
struct cubic_hectometre : deduced_unit<cubic_hectometre, dim_volume, hectometre> {};
struct cubic_kilometre : deduced_unit<cubic_kilometre, dim_volume, kilometre> {};
struct cubic_megametre : deduced_unit<cubic_megametre, dim_volume, megametre> {};
struct cubic_gigametre : deduced_unit<cubic_gigametre, dim_volume, gigametre> {};
struct cubic_terametre : deduced_unit<cubic_terametre, dim_volume, terametre> {};
struct cubic_petametre : deduced_unit<cubic_petametre, dim_volume, petametre> {};
struct cubic_exametre : deduced_unit<cubic_exametre, dim_volume, exametre> {};
struct cubic_zettametre : deduced_unit<cubic_zettametre, dim_volume, zettametre> {};
struct cubic_yottametre : deduced_unit<cubic_yottametre, dim_volume, yottametre> {};
struct litre : alias_unit<cubic_decimetre, "l", prefix> {};
struct yoctolitre : prefixed_alias_unit<cubic_nanometre, yocto, litre> {};
struct zeptolitre : prefixed_unit<zeptolitre, zepto, litre> {};
struct attolitre : prefixed_unit<attolitre, atto, litre> {};
struct femtolitre : prefixed_alias_unit<cubic_micrometre, femto, litre> {};
struct picolitre : prefixed_unit<picolitre, pico, litre> {};
struct nanolitre : prefixed_unit<nanolitre, nano, litre> {};
struct microlitre : prefixed_alias_unit<cubic_millimetre, micro, litre> {};
struct millilitre : prefixed_alias_unit<cubic_centimetre, milli, litre> {};
struct centilitre : prefixed_unit<centilitre, centi, litre> {};
struct decilitre : prefixed_unit<decilitre, deci, litre> {};
struct decalitre : prefixed_unit<decalitre, deca, litre> {};
struct hectolitre : prefixed_alias_unit<cubic_decimetre, hecto, litre> {};
struct kilolitre : prefixed_alias_unit<cubic_metre, kilo, litre> {};
struct megalitre : prefixed_alias_unit<cubic_decametre, mega, litre> {};
struct gigalitre : prefixed_alias_unit<cubic_hectometre, giga, litre> {};
struct teralitre : prefixed_alias_unit<cubic_kilometre, tera, litre> {};
struct petalitre : prefixed_unit<petalitre, peta, litre> {};
struct exalitre : prefixed_unit<exalitre, exa, litre> {};
struct zettalitre : prefixed_alias_unit<cubic_megametre, zetta, litre> {};
struct yottalitre : prefixed_unit<yottalitre, yotta, litre> {};
template<UnitOf<dim_volume> U, QuantityValue Rep = double>
using volume = quantity<dim_volume, U, Rep>;
inline namespace literals {
// m3
constexpr auto operator"" _q_m3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_metre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_m3(long double l) { return volume<cubic_metre, long double>(l); }
// ym3
constexpr auto operator"" _q_ym3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_yoctometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ym3(long double l) { return volume<cubic_yoctometre, long double>(l); }
// zm3
constexpr auto operator"" _q_zm3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_zeptometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zm3(long double l) { return volume<cubic_zeptometre, long double>(l); }
// am3
constexpr auto operator"" _q_am3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_attometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_am3(long double l) { return volume<cubic_attometre, long double>(l); }
// fm3
constexpr auto operator"" _q_fm3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_femtometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fm3(long double l) { return volume<cubic_femtometre, long double>(l); }
// pm3
constexpr auto operator"" _q_pm3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_picometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pm3(long double l) { return volume<cubic_picometre, long double>(l); }
// nm3
constexpr auto operator"" _q_nm3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_nanometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nm3(long double l) { return volume<cubic_nanometre, long double>(l); }
// um3
constexpr auto operator"" _q_um3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_micrometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_um3(long double l) { return volume<cubic_micrometre, long double>(l); }
// mm3
constexpr auto operator"" _q_mm3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_millimetre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_mm3(long double l) { return volume<cubic_millimetre, long double>(l); }
// cm3
constexpr auto operator"" _q_cm3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_centimetre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cm3(long double l) { return volume<cubic_centimetre, long double>(l); }
// dm3
constexpr auto operator"" _q_dm3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_decimetre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dm3(long double l) { return volume<cubic_decimetre, long double>(l); }
// dam3
constexpr auto operator"" _q_dam3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_decametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dam3(long double l) { return volume<cubic_decametre, long double>(l); }
// hm3
constexpr auto operator"" _q_hm3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_hectometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hm3(long double l) { return volume<cubic_hectometre, long double>(l); }
// km3
constexpr auto operator"" _q_km3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_kilometre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_km3(long double l) { return volume<cubic_kilometre, long double>(l); }
// Mm3
constexpr auto operator"" _q_Mm3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_megametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Mm3(long double l) { return volume<cubic_megametre, long double>(l); }
// Gm3
constexpr auto operator"" _q_Gm3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_gigametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Gm3(long double l) { return volume<cubic_gigametre, long double>(l); }
// Tm3
constexpr auto operator"" _q_Tm3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_terametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Tm3(long double l) { return volume<cubic_terametre, long double>(l); }
// Pm3
constexpr auto operator"" _q_Pm3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_petametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Pm3(long double l) { return volume<cubic_petametre, long double>(l); }
// Em3
constexpr auto operator"" _q_Em3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_exametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Em3(long double l) { return volume<cubic_exametre, long double>(l); }
// Zm3
constexpr auto operator"" _q_Zm3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_zettametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Zm3(long double l) { return volume<cubic_zettametre, long double>(l); }
// Ym3
constexpr auto operator"" _q_Ym3(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<cubic_yottametre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Ym3(long double l) { return volume<cubic_yottametre, long double>(l); }
// l
constexpr auto operator"" _q_l(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<litre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_l(long double l) { return volume<litre, long double>(l); }
// yl
constexpr auto operator"" _q_yl(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<yoctolitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_yl(long double l) { return volume<yoctolitre, long double>(l); }
// zl
constexpr auto operator"" _q_zl(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<zeptolitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_zl(long double l) { return volume<zeptolitre, long double>(l); }
// al
constexpr auto operator"" _q_al(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<attolitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_al(long double l) { return volume<attolitre, long double>(l); }
// fl
constexpr auto operator"" _q_fl(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<femtolitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_fl(long double l) { return volume<femtolitre, long double>(l); }
// pl
constexpr auto operator"" _q_pl(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<picolitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_pl(long double l) { return volume<picolitre, long double>(l); }
// nl
constexpr auto operator"" _q_nl(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<nanolitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_nl(long double l) { return volume<nanolitre, long double>(l); }
// ul
constexpr auto operator"" _q_ul(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<microlitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ul(long double l) { return volume<microlitre, long double>(l); }
// ml
constexpr auto operator"" _q_ml(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<millilitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_ml(long double l) { return volume<millilitre, long double>(l); }
// cl
constexpr auto operator"" _q_cl(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<centilitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_cl(long double l) { return volume<centilitre, long double>(l); }
// dl
constexpr auto operator"" _q_dl(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<decilitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dl(long double l) { return volume<decilitre, long double>(l); }
// dal
constexpr auto operator"" _q_dal(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<decalitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_dal(long double l) { return volume<decalitre, long double>(l); }
// hl
constexpr auto operator"" _q_hl(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<hectolitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_hl(long double l) { return volume<hectolitre, long double>(l); }
// kl
constexpr auto operator"" _q_kl(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<kilolitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_kl(long double l) { return volume<kilolitre, long double>(l); }
// Ml
constexpr auto operator"" _q_Ml(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<megalitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Ml(long double l) { return volume<megalitre, long double>(l); }
// Gl
constexpr auto operator"" _q_Gl(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<gigalitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Gl(long double l) { return volume<gigalitre, long double>(l); }
// Tl
constexpr auto operator"" _q_Tl(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<teralitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Tl(long double l) { return volume<teralitre, long double>(l); }
// Pl
constexpr auto operator"" _q_Pl(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<petalitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Pl(long double l) { return volume<petalitre, long double>(l); }
// El
constexpr auto operator"" _q_El(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<exalitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_El(long double l) { return volume<exalitre, long double>(l); }
// Zl
constexpr auto operator"" _q_Zl(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<zettalitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Zl(long double l) { return volume<zettalitre, long double>(l); }
// Yl
constexpr auto operator"" _q_Yl(unsigned long long l) { gsl_ExpectsAudit(std::in_range<std::int64_t>(l)); return volume<yottalitre, std::int64_t>(static_cast<std::int64_t>(l)); }
constexpr auto operator"" _q_Yl(long double l) { return volume<yottalitre, long double>(l); }
} // namespace literals
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>{};
} // namespace unit_constants
} // namespace units::isq::si