|
quanta 0.1.0
Type-safe units for temperature, frequency, electrical and spatial quantities, modeled after std::chrono
|
Electrical unit types and arithmetic, modeled after std::chrono. More...
#include <assert.h>#include <charconv>#include <chrono>#include <cmath>#include <compare>#include <concepts>#include <cstddef>#include <cstdint>#include <limits>#include <quanta/core.hpp>#include <ratio>#include <string>#include <system_error>#include <type_traits>Go to the source code of this file.
Namespaces | |
| namespace | quanta |
| Type-safe units modeled after std::chrono. | |
| namespace | quanta::electro |
| Electrical unit types and utilities. | |
| namespace | std |
| namespace | quanta::literals |
| namespace | quanta::literals::electro_literals |
Typedefs | |
| template<typename Rep , typename Precision = std::ratio<1>> | |
| using | quanta::electro::voltage = quantity< volt_unit, Rep, Precision > |
| Voltage quantity with configurable representation and precision. | |
| template<typename Rep , typename Precision = std::ratio<1>> | |
| using | quanta::electro::current = quantity< ampere_unit, Rep, Precision > |
| Current quantity with configurable representation and precision. | |
| template<typename Rep , typename Precision = std::ratio<1>> | |
| using | quanta::electro::resistance = quantity< ohm_unit, Rep, Precision > |
| Resistance quantity with configurable representation and precision. | |
| template<typename Rep , typename Precision = std::ratio<1>> | |
| using | quanta::electro::power = quantity< watt_unit, Rep, Precision > |
| Power quantity with configurable representation and precision. | |
| template<typename Rep , typename Precision = std::ratio<1>> | |
| using | quanta::electro::charge = quantity< coulomb_unit, Rep, Precision > |
| Charge quantity with configurable representation and precision. | |
| template<typename Rep , typename Precision = std::ratio<1>> | |
| using | quanta::electro::energy = quantity< joule_unit, Rep, Precision > |
| Energy quantity with configurable representation and precision. | |
| template<typename Rep , typename Precision = std::ratio<1>> | |
| using | quanta::electro::capacitance = quantity< farad_unit, Rep, Precision > |
| Capacitance quantity with configurable representation and precision. | |
| template<typename Rep , typename Precision = std::ratio<1>> | |
| using | quanta::electro::inductance = quantity< henry_unit, Rep, Precision > |
| Inductance quantity with configurable representation and precision. | |
| using | quanta::electro::microvolts = voltage< int64_t, std::micro > |
| Voltage with 1 µV precision. | |
| using | quanta::electro::millivolts = voltage< int64_t, std::milli > |
| Voltage with 1 mV precision. | |
| using | quanta::electro::volts = voltage< int64_t > |
| Voltage with 1 V precision. | |
| using | quanta::electro::kilovolts = voltage< int64_t, std::kilo > |
| Voltage with 1 kV precision. | |
| using | quanta::electro::microamperes = current< int64_t, std::micro > |
| Current with 1 µA precision. | |
| using | quanta::electro::milliamperes = current< int64_t, std::milli > |
| Current with 1 mA precision. | |
| using | quanta::electro::amperes = current< int64_t > |
| Current with 1 A precision. | |
| using | quanta::electro::microamps = microamperes |
| Shorthand for microamperes. | |
| using | quanta::electro::milliamps = milliamperes |
| Shorthand for milliamperes. | |
| using | quanta::electro::amps = amperes |
| Shorthand for amperes. | |
| using | quanta::electro::milliohms = resistance< int64_t, std::milli > |
| Resistance with 1 mΩ precision. | |
| using | quanta::electro::ohms = resistance< int64_t > |
| Resistance with 1 Ω precision. | |
| using | quanta::electro::kiloohms = resistance< int64_t, std::kilo > |
| Resistance with 1 kΩ precision. | |
| using | quanta::electro::megaohms = resistance< int64_t, std::mega > |
| Resistance with 1 MΩ precision. | |
| using | quanta::electro::gigaohms = resistance< int64_t, std::giga > |
| Resistance with 1 GΩ precision. | |
| using | quanta::electro::microwatts = power< int64_t, std::micro > |
| Power with 1 µW precision. | |
| using | quanta::electro::milliwatts = power< int64_t, std::milli > |
| Power with 1 mW precision. | |
| using | quanta::electro::watts = power< int64_t > |
| Power with 1 W precision. | |
| using | quanta::electro::kilowatts = power< int64_t, std::kilo > |
| Power with 1 kW precision. | |
| using | quanta::electro::megawatts = power< int64_t, std::mega > |
| Power with 1 MW precision. | |
| using | quanta::electro::gigawatts = power< int64_t, std::giga > |
| Power with 1 GW precision. | |
| using | quanta::electro::microcoulombs = charge< int64_t, std::micro > |
| Charge with 1 µC precision. | |
| using | quanta::electro::millicoulombs = charge< int64_t, std::milli > |
| Charge with 1 mC precision. | |
| using | quanta::electro::coulombs = charge< int64_t > |
| Charge with 1 C precision. | |
| using | quanta::electro::milliampere_hours = charge< int64_t, std::ratio< 18, 5 > > |
| Charge with 1 mAh (3.6 C) precision. | |
| using | quanta::electro::ampere_hours = charge< int64_t, std::ratio< 3600 > > |
| Charge with 1 Ah (3600 C) precision. | |
| using | quanta::electro::millijoules = energy< int64_t, std::milli > |
| Energy with 1 mJ precision. | |
| using | quanta::electro::joules = energy< int64_t > |
| Energy with 1 J precision. | |
| using | quanta::electro::kilojoules = energy< int64_t, std::kilo > |
| Energy with 1 kJ precision. | |
| using | quanta::electro::megajoules = energy< int64_t, std::mega > |
| Energy with 1 MJ precision. | |
| using | quanta::electro::watt_hours = energy< int64_t, std::ratio< 3600 > > |
| Energy with 1 Wh (3600 J) precision. | |
| using | quanta::electro::kilowatt_hours = energy< int64_t, std::ratio< 3600000 > > |
| Energy with 1 kWh (3,600,000 J) precision. | |
| using | quanta::electro::picofarads = capacitance< int64_t, std::pico > |
| Capacitance with 1 pF precision. | |
| using | quanta::electro::nanofarads = capacitance< int64_t, std::nano > |
| Capacitance with 1 nF precision. | |
| using | quanta::electro::microfarads = capacitance< int64_t, std::micro > |
| Capacitance with 1 µF precision. | |
| using | quanta::electro::millifarads = capacitance< int64_t, std::milli > |
| Capacitance with 1 mF precision. | |
| using | quanta::electro::farads = capacitance< int64_t > |
| Capacitance with 1 F precision. | |
| using | quanta::electro::nanohenries = inductance< int64_t, std::nano > |
| Inductance with 1 nH precision. | |
| using | quanta::electro::microhenries = inductance< int64_t, std::micro > |
| Inductance with 1 µH precision. | |
| using | quanta::electro::millihenries = inductance< int64_t, std::milli > |
| Inductance with 1 mH precision. | |
| using | quanta::electro::henries = inductance< int64_t > |
| Inductance with 1 H precision. | |
Functions | |
| template<typename ToQuantity , typename Unit , typename Rep , typename Precision > requires (!std::is_same_v<typename ToQuantity::unit, Unit>) || detail::_quantity_cast_requirements<quantity<Unit, Rep, Precision>, ToQuantity> | |
| constexpr ToQuantity | quanta::electro::quantity_cast (const quantity< Unit, Rep, Precision > &q) |
| Converts a quantity to a different precision or representation. | |
| template<typename ToQuantity , typename Unit , typename Rep , typename Precision > | |
| constexpr ToQuantity | quanta::electro::floor (const quantity< Unit, Rep, Precision > &q) |
| Converts a quantity to the target type, rounding toward negative infinity. | |
| template<typename ToQuantity , typename Unit , typename Rep , typename Precision > | |
| constexpr ToQuantity | quanta::electro::ceil (const quantity< Unit, Rep, Precision > &q) |
| Converts a quantity to the target type, rounding toward positive infinity. | |
| template<typename ToQuantity , typename Unit , typename Rep , typename Precision > | |
| constexpr ToQuantity | quanta::electro::trunc (const quantity< Unit, Rep, Precision > &q) |
| Converts a quantity to the target type, rounding toward zero. | |
| template<typename ToQuantity , typename Unit , typename Rep , typename Precision > | |
| constexpr ToQuantity | quanta::electro::round (const quantity< Unit, Rep, Precision > &q) |
| Converts a quantity to the target type, rounding to nearest (ties to even). | |
| template<typename Unit , typename Rep , typename Precision > | |
| constexpr quantity< Unit, Rep, Precision > | quanta::electro::abs (const quantity< Unit, Rep, Precision > &q) |
| Returns the absolute value of a quantity. | |
| template<typename Unit , typename Rep1 , typename Precision1 , typename Rep2 , typename Precision2 > | |
| constexpr auto | quanta::electro::operator+ (const quantity< Unit, Rep1, Precision1 > &lhs, const quantity< Unit, Rep2, Precision2 > &rhs) -> std::common_type_t< quantity< Unit, Rep1, Precision1 >, quantity< Unit, Rep2, Precision2 > > |
| Returns the sum of two quantities of the same unit. | |
| template<typename Unit , typename Rep1 , typename Precision1 , typename Rep2 , typename Precision2 > | |
| constexpr auto | quanta::electro::operator- (const quantity< Unit, Rep1, Precision1 > &lhs, const quantity< Unit, Rep2, Precision2 > &rhs) -> std::common_type_t< quantity< Unit, Rep1, Precision1 >, quantity< Unit, Rep2, Precision2 > > |
| Returns the difference of two quantities of the same unit. | |
| template<typename Unit , typename Rep1 , typename Precision , typename Rep2 > requires not_quantity<Rep2> && std::convertible_to<const Rep2&, std::common_type_t<Rep1, Rep2>> | |
| constexpr auto | quanta::electro::operator* (const quantity< Unit, Rep1, Precision > &q, const Rep2 &r) -> quantity< Unit, std::common_type_t< Rep1, Rep2 >, Precision > |
| Multiplies a quantity by a scalar. | |
| template<typename Unit , typename Rep1 , typename Rep2 , typename Precision > requires not_quantity<Rep1> && std::convertible_to<const Rep1&, std::common_type_t<Rep1, Rep2>> | |
| constexpr auto | quanta::electro::operator* (const Rep1 &r, const quantity< Unit, Rep2, Precision > &q) -> quantity< Unit, std::common_type_t< Rep1, Rep2 >, Precision > |
| Multiplies a scalar by a quantity. | |
| template<typename Unit , typename Rep1 , typename Precision , typename Rep2 > requires not_quantity<Rep2> && std::convertible_to<const Rep2&, std::common_type_t<Rep1, Rep2>> | |
| constexpr auto | quanta::electro::operator/ (const quantity< Unit, Rep1, Precision > &q, const Rep2 &s) -> quantity< Unit, std::common_type_t< Rep1, Rep2 >, Precision > |
| Divides a quantity by a scalar. | |
| template<typename Unit , typename Rep1 , typename Precision1 , typename Rep2 , typename Precision2 > | |
| constexpr auto | quanta::electro::operator/ (const quantity< Unit, Rep1, Precision1 > &lhs, const quantity< Unit, Rep2, Precision2 > &rhs) -> std::common_type_t< Rep1, Rep2 > |
| Divides two quantities of the same unit, returning a scalar. | |
| template<typename Unit , typename Rep1 , typename Precision , typename Rep2 > requires not_quantity<Rep2> && std::convertible_to<const Rep2&, std::common_type_t<Rep1, Rep2>> && (!treat_as_inexact_v<Rep1> && !treat_as_inexact_v<Rep2>) | |
| constexpr auto | quanta::electro::operator% (const quantity< Unit, Rep1, Precision > &q, const Rep2 &s) -> quantity< Unit, std::common_type_t< Rep1, Rep2 >, Precision > |
| Returns the remainder of dividing a quantity by a scalar. | |
| template<typename Unit , typename Rep1 , typename Precision1 , typename Rep2 , typename Precision2 > requires (!treat_as_inexact_v<Rep1> && !treat_as_inexact_v<Rep2>) | |
| constexpr auto | quanta::electro::operator% (const quantity< Unit, Rep1, Precision1 > &lhs, const quantity< Unit, Rep2, Precision2 > &rhs) -> std::common_type_t< quantity< Unit, Rep1, Precision1 >, quantity< Unit, Rep2, Precision2 > > |
| Returns the remainder of dividing two quantities of the same unit. | |
| template<typename Unit , typename Rep1 , typename Precision1 , typename Rep2 , typename Precision2 > | |
| constexpr bool | quanta::electro::operator== (const quantity< Unit, Rep1, Precision1 > &lhs, const quantity< Unit, Rep2, Precision2 > &rhs) |
| template<typename Unit , typename Rep1 , typename Precision1 , typename Rep2 , typename Precision2 > requires std::three_way_comparable<std::common_type_t<Rep1, Rep2>> | |
| constexpr auto | quanta::electro::operator<=> (const quantity< Unit, Rep1, Precision1 > &lhs, const quantity< Unit, Rep2, Precision2 > &rhs) |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator* (const quantity< ampere_unit, R1, P1 > &i, const quantity< ohm_unit, R2, P2 > &r) |
| Ohm's law: current x resistance = voltage. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator* (const quantity< ohm_unit, R1, P1 > &r, const quantity< ampere_unit, R2, P2 > &i) |
| Ohm's law: resistance x current = voltage. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator/ (const quantity< volt_unit, R1, P1 > &v, const quantity< ohm_unit, R2, P2 > &r) |
| Ohm's law: voltage / resistance = current. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator/ (const quantity< volt_unit, R1, P1 > &v, const quantity< ampere_unit, R2, P2 > &i) |
| Ohm's law: voltage / current = resistance. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator* (const quantity< volt_unit, R1, P1 > &v, const quantity< ampere_unit, R2, P2 > &i) |
| Power law: voltage x current = power. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator* (const quantity< ampere_unit, R1, P1 > &i, const quantity< volt_unit, R2, P2 > &v) |
| Power law: current x voltage = power. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator/ (const quantity< watt_unit, R1, P1 > &p, const quantity< volt_unit, R2, P2 > &v) |
| Power law: power / voltage = current. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator/ (const quantity< watt_unit, R1, P1 > &p, const quantity< ampere_unit, R2, P2 > &i) |
| Power law: power / current = voltage. | |
| template<typename R1 , typename P1 , duration_like D> | |
| constexpr auto | quanta::electro::operator* (const quantity< ampere_unit, R1, P1 > &i, const D &t) |
| Charge: current x time = charge. | |
| template<duration_like D, typename R1 , typename P1 > | |
| constexpr auto | quanta::electro::operator* (const D &t, const quantity< ampere_unit, R1, P1 > &i) |
| Charge: time x current = charge. | |
| template<typename R1 , typename P1 , duration_like D> | |
| constexpr auto | quanta::electro::operator/ (const quantity< coulomb_unit, R1, P1 > &q, const D &t) |
| Charge: charge / time = current. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator/ (const quantity< coulomb_unit, R1, P1 > &q, const quantity< ampere_unit, R2, P2 > &i) |
| Charge: charge / current = time. | |
| template<typename R1 , typename P1 , duration_like D> | |
| constexpr auto | quanta::electro::operator* (const quantity< watt_unit, R1, P1 > &p, const D &t) |
| Energy: power x time = energy. | |
| template<duration_like D, typename R1 , typename P1 > | |
| constexpr auto | quanta::electro::operator* (const D &t, const quantity< watt_unit, R1, P1 > &p) |
| Energy: time x power = energy. | |
| template<typename R1 , typename P1 , duration_like D> | |
| constexpr auto | quanta::electro::operator/ (const quantity< joule_unit, R1, P1 > &e, const D &t) |
| Energy: energy / time = power. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator/ (const quantity< joule_unit, R1, P1 > &e, const quantity< watt_unit, R2, P2 > &p) |
| Energy: energy / power = time. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator/ (const quantity< joule_unit, R1, P1 > &e, const quantity< volt_unit, R2, P2 > &v) |
| Energy: energy / voltage = charge. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator/ (const quantity< joule_unit, R1, P1 > &e, const quantity< coulomb_unit, R2, P2 > &q) |
| Energy: energy / charge = voltage. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator* (const quantity< farad_unit, R1, P1 > &c, const quantity< volt_unit, R2, P2 > &v) |
| Capacitance: capacitance x voltage = charge. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator* (const quantity< volt_unit, R1, P1 > &v, const quantity< farad_unit, R2, P2 > &c) |
| Capacitance: voltage x capacitance = charge. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator/ (const quantity< coulomb_unit, R1, P1 > &q, const quantity< volt_unit, R2, P2 > &v) |
| Capacitance: charge / voltage = capacitance. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator/ (const quantity< coulomb_unit, R1, P1 > &q, const quantity< farad_unit, R2, P2 > &c) |
| Capacitance: charge / capacitance = voltage. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator* (const quantity< ohm_unit, R1, P1 > &r, const quantity< farad_unit, R2, P2 > &c) |
| RC time constant: resistance x capacitance = time. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator* (const quantity< farad_unit, R1, P1 > &c, const quantity< ohm_unit, R2, P2 > &r) |
| RC time constant: capacitance x resistance = time. | |
| template<typename R1 , typename P1 , typename R2 , typename P2 > | |
| constexpr auto | quanta::electro::operator/ (const quantity< henry_unit, R1, P1 > &l, const quantity< ohm_unit, R2, P2 > &r) |
| L/R time constant: inductance / resistance = time. | |
| template<typename Unit , typename Rep , typename Precision > requires _has_suffix<Unit, typename Precision::type> | |
| std::string | quanta::electro::to_string (const quantity< Unit, Rep, Precision > &q) |
| Converts a quantity to a string with its unit suffix. | |
| template<typename Unit , typename Rep , typename Precision > requires _has_suffix<Unit, typename Precision::type> | |
| std::string | quanta::electro::to_string (const quantity< Unit, Rep, Precision > &q, base_unit_t) |
| Converts a quantity to a string in its base unit. | |
| template<typename Unit , typename Rep , typename Precision > requires _has_suffix<Unit, typename Precision::type> | |
| std::string | quanta::electro::to_string (const quantity< Unit, Rep, Precision > &q, scaled_t) |
| Converts a quantity to a string with an SI prefix suited to its magnitude. | |
| template<char... Digits> | |
| constexpr quanta::electro::microvolts | quanta::literals::electro_literals::operator""_uV () |
| Literal for microvolts (e.g., 500_uV). | |
| template<char... Digits> | |
| constexpr quanta::electro::millivolts | quanta::literals::electro_literals::operator""_mV () |
| Literal for millivolts (e.g., 3300_mV). | |
| template<char... Digits> | |
| constexpr quanta::electro::volts | quanta::literals::electro_literals::operator""_V () |
| Literal for volts (e.g., 5_V). | |
| template<char... Digits> | |
| constexpr quanta::electro::kilovolts | quanta::literals::electro_literals::operator""_kV () |
| Literal for kilovolts (e.g., 11_kV). | |
| template<char... Digits> | |
| constexpr quanta::electro::microamperes | quanta::literals::electro_literals::operator""_uA () |
| Literal for microamperes (e.g., 250_uA). | |
| template<char... Digits> | |
| constexpr quanta::electro::milliamperes | quanta::literals::electro_literals::operator""_mA () |
| Literal for milliamperes (e.g., 150_mA). | |
| template<char... Digits> | |
| constexpr quanta::electro::amperes | quanta::literals::electro_literals::operator""_A () |
| Literal for amperes (e.g., 2_A). | |
| template<char... Digits> | |
| constexpr quanta::electro::milliohms | quanta::literals::electro_literals::operator""_mOhm () |
| Literal for milliohms (e.g., 50_mOhm). | |
| template<char... Digits> | |
| constexpr quanta::electro::ohms | quanta::literals::electro_literals::operator""_Ohm () |
| Literal for ohms (e.g., 220_Ohm). | |
| template<char... Digits> | |
| constexpr quanta::electro::kiloohms | quanta::literals::electro_literals::operator""_kOhm () |
| Literal for kiloohms (e.g., 10_kOhm). | |
| template<char... Digits> | |
| constexpr quanta::electro::megaohms | quanta::literals::electro_literals::operator""_MOhm () |
| Literal for megaohms (e.g., 1_MOhm). | |
| template<char... Digits> | |
| constexpr quanta::electro::milliohms | quanta::literals::electro_literals::operator""_mΩ () |
| Literal for milliohms (e.g., 50_mΩ). | |
| template<char... Digits> | |
| constexpr quanta::electro::ohms | quanta::literals::electro_literals::operator""_Ω () |
| Literal for ohms (e.g., 220_Ω). | |
| template<char... Digits> | |
| constexpr quanta::electro::kiloohms | quanta::literals::electro_literals::operator""_kΩ () |
| Literal for kiloohms (e.g., 10_kΩ). | |
| template<char... Digits> | |
| constexpr quanta::electro::megaohms | quanta::literals::electro_literals::operator""_MΩ () |
| Literal for megaohms (e.g., 1_MΩ). | |
| template<char... Digits> | |
| constexpr quanta::electro::microwatts | quanta::literals::electro_literals::operator""_uW () |
| Literal for microwatts (e.g., 500_uW). | |
| template<char... Digits> | |
| constexpr quanta::electro::milliwatts | quanta::literals::electro_literals::operator""_mW () |
| Literal for milliwatts (e.g., 250_mW). | |
| template<char... Digits> | |
| constexpr quanta::electro::watts | quanta::literals::electro_literals::operator""_W () |
| Literal for watts (e.g., 60_W). | |
| template<char... Digits> | |
| constexpr quanta::electro::kilowatts | quanta::literals::electro_literals::operator""_kW () |
| Literal for kilowatts (e.g., 2_kW). | |
| template<char... Digits> | |
| constexpr quanta::electro::megawatts | quanta::literals::electro_literals::operator""_MW () |
| Literal for megawatts (e.g., 5_MW). | |
| template<char... Digits> | |
| constexpr quanta::electro::coulombs | quanta::literals::electro_literals::operator""_C () |
| Literal for coulombs (e.g., 10_C). | |
| template<char... Digits> | |
| constexpr quanta::electro::milliampere_hours | quanta::literals::electro_literals::operator""_mAh () |
| Literal for milliampere-hours (e.g., 2000_mAh). | |
| template<char... Digits> | |
| constexpr quanta::electro::ampere_hours | quanta::literals::electro_literals::operator""_Ah () |
| Literal for ampere-hours (e.g., 2_Ah). | |
| template<char... Digits> | |
| constexpr quanta::electro::millijoules | quanta::literals::electro_literals::operator""_mJ () |
| Literal for millijoules (e.g., 500_mJ). | |
| template<char... Digits> | |
| constexpr quanta::electro::joules | quanta::literals::electro_literals::operator""_J () |
| Literal for joules (e.g., 100_J). | |
| template<char... Digits> | |
| constexpr quanta::electro::kilojoules | quanta::literals::electro_literals::operator""_kJ () |
| Literal for kilojoules (e.g., 4_kJ). | |
| template<char... Digits> | |
| constexpr quanta::electro::watt_hours | quanta::literals::electro_literals::operator""_Wh () |
| Literal for watt-hours (e.g., 100_Wh). | |
| template<char... Digits> | |
| constexpr quanta::electro::kilowatt_hours | quanta::literals::electro_literals::operator""_kWh () |
| Literal for kilowatt-hours (e.g., 10_kWh). | |
| template<char... Digits> | |
| constexpr quanta::electro::picofarads | quanta::literals::electro_literals::operator""_pF () |
| Literal for picofarads (e.g., 22_pF). | |
| template<char... Digits> | |
| constexpr quanta::electro::nanofarads | quanta::literals::electro_literals::operator""_nF () |
| Literal for nanofarads (e.g., 100_nF). | |
| template<char... Digits> | |
| constexpr quanta::electro::microfarads | quanta::literals::electro_literals::operator""_uF () |
| Literal for microfarads (e.g., 10_uF). | |
| template<char... Digits> | |
| constexpr quanta::electro::farads | quanta::literals::electro_literals::operator""_F () |
| Literal for farads (e.g., 1_F). | |
| template<char... Digits> | |
| constexpr quanta::electro::nanohenries | quanta::literals::electro_literals::operator""_nH () |
| Literal for nanohenries (e.g., 100_nH). | |
| template<char... Digits> | |
| constexpr quanta::electro::microhenries | quanta::literals::electro_literals::operator""_uH () |
| Literal for microhenries (e.g., 47_uH). | |
| template<char... Digits> | |
| constexpr quanta::electro::millihenries | quanta::literals::electro_literals::operator""_mH () |
| Literal for millihenries (e.g., 10_mH). | |
| template<char... Digits> | |
| constexpr quanta::electro::henries | quanta::literals::electro_literals::operator""_H () |
| Literal for henries (e.g., 1_H). | |
Variables | |
| template<typename T > | |
| constexpr bool | quanta::electro::is_quantity_v = is_quantity<T>::value |
Electrical unit types and arithmetic, modeled after std::chrono.
Definition in file electro.hpp.