refactor: ♻️ more file system related cleanup (mostly physical dimensions definitions)

BREAKING_CHANGE: current, substance, temperature renamed to proper names
This commit is contained in:
Mateusz Pusz
2020-09-11 21:16:26 +02:00
parent 2d51b2f233
commit f4747a4d7d
73 changed files with 2283 additions and 769 deletions

View File

@@ -1,4 +1,4 @@
Current Current
======= =======
.. doxygenfile:: si/base/current.h .. doxygenfile:: si/base/electric_current.h

View File

@@ -1,4 +1,4 @@
Substance Substance
========= =========
.. doxygenfile:: si/base/substance.h .. doxygenfile:: si/base/amount_of_substance.h

View File

@@ -1,4 +1,4 @@
Temperature Temperature
=========== ===========
.. doxygenfile:: si/base/temperature.h .. doxygenfile:: si/base/thermodynamic_temperature.h

View File

@@ -21,6 +21,7 @@
// SOFTWARE. // SOFTWARE.
#include <units/format.h> #include <units/format.h>
#include <units/generic/angle.h>
#include <units/physical/si/si.h> #include <units/physical/si/si.h>
#include <iostream> #include <iostream>
@@ -32,7 +33,7 @@ int main()
auto torque = 20.0_q_Nm; auto torque = 20.0_q_Nm;
auto energy = 20.0_q_J; auto energy = 20.0_q_J;
physical::Angle auto angle = torque / energy; Angle auto angle = torque / energy;
std::cout << angle << '\n'; std::cout << angle << '\n';
} }

View File

@@ -23,7 +23,7 @@
#pragma once #pragma once
#include <units/bits/external/fixed_string.h> #include <units/bits/external/fixed_string.h>
#include <units/concepts.h> #include <units/bits/basic_concepts.h>
#include <type_traits> #include <type_traits>
namespace units { namespace units {

View File

@@ -0,0 +1,289 @@
// The MIT License (MIT)
//
// Copyright (c) 2018 Mateusz Pusz
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#pragma once
#include <units/bits/external/downcasting.h>
#include <units/bits/external/fixed_string.h>
#include <units/bits/external/hacks.h>
#include <units/ratio.h>
#include <units/bits/external/type_traits.h>
#include <functional>
#include <cstdint>
#include <utility>
namespace units {
// PrefixFamily
struct prefix_family;
/**
* @brief A concept matching a prefix family
*
* Satisfied by all types derived from `prefix_family`
*/
template<typename T>
concept PrefixFamily = std::derived_from<T, prefix_family>;
// Prefix
namespace detail {
template<PrefixFamily PF, ratio R>
struct prefix_base;
template<PrefixFamily PF, ratio R>
void to_prefix_base(const volatile prefix_base<PF, R>*);
} // namespace detail
/**
* @brief A concept matching a symbol prefix
*
* Satisfied by all specializations of `prefix`.
*/
template<typename T>
concept Prefix = requires(const volatile T* t) { detail::to_prefix_base(t); };
/**
* @brief A concept matching unit's ratio
*
* Satisfied by all ratio values for which `R.num > 0` and `R.den > 0`.
*/
template<ratio R>
concept UnitRatio = R.num > 0 && R.den > 0;
// Unit
template<ratio R, typename U>
requires UnitRatio<R>
struct scaled_unit;
// TODO: Remove when P1985 accepted
namespace detail {
template<ratio R, typename U>
void to_base_scaled_unit(const volatile scaled_unit<R, U>*);
} // namespace detail
/**
* @brief A concept matching all unit types in the library
*
* Satisfied by all unit types derived from an specialization of :class:`scaled_unit`.
*/
template<typename T>
concept Unit = requires { detail::to_base_scaled_unit(std::declval<const volatile T*>()); };
// BaseDimension
template<basic_fixed_string Symbol, Unit U>
requires U::is_named
struct base_dimension;
namespace detail {
template<basic_fixed_string Symbol, typename U>
void to_base_base_dimension(const volatile base_dimension<Symbol, U>*);
} // namespace detail
/**
* @brief A concept matching all base dimensions in the library.
*
* Satisfied by all dimension types derived from an specialization of `base_dimension`.
*/
template<typename T>
concept BaseDimension = requires { detail::to_base_base_dimension(std::declval<const volatile T*>()); };
// Exponent
namespace detail {
template<typename T>
inline constexpr bool is_exponent = false;
} // namespace detail
/**
* @brief A concept matching dimension's exponents.
*
* Satisfied by all specializations of :class:`exponent`.
*/
template<typename T>
concept Exponent = detail::is_exponent<T>;
// DerivedDimension
namespace detail {
template<Exponent... Es>
requires (BaseDimension<typename Es::dimension> && ...)
struct derived_dimension_base;
} // namespace detail
/**
* @brief A concept matching all derived dimensions in the library.
*
* Satisfied by all dimension types derived from an specialization of `detail::derived_dimension_base`.
*/
template<typename T>
concept DerivedDimension = is_derived_from_specialization_of<T, detail::derived_dimension_base>;
// Dimension
/**
* @brief A concept matching all dimensions in the library.
*
* Satisfied by all dimension types for which either `BaseDimension<T>` or `DerivedDimension<T>` is `true`.
*/
template<typename T>
concept Dimension = BaseDimension<T> || DerivedDimension<T>;
// UnitOf
namespace detail {
template<Dimension D>
auto default_unit()
{
if constexpr (BaseDimension<D>)
return typename D::base_unit{};
else
return typename D::coherent_unit{};
}
} // namespace detail
/**
* @brief Returns a 'default' unit of the dimension
*
* Depending on the dimension type it returns a base unit (for base dimensions)
* or a coherent unit (in case of derived dimensions).
*
* @tparam D Dimension type to get the unit from.
*/
template<Dimension D>
using dimension_unit = decltype(detail::default_unit<D>());
// TODO: replace with the below code when VS catches up
// decltype([]{
// if constexpr (BaseDimension<D>)
// return TYPENAME D::base_unit{};
// else
// return TYPENAME D::coherent_unit{};
// }());
/**
* @brief A concept matching only units of a specified dimension.
*
* Satisfied by all unit types that satisfy `Unit<U>`, `Dimension<D>`, and for which
* `U::reference` and @c dimension_unit<D>::reference denote the same unit type.
*
* @tparam U Type to verify.
* @tparam D Dimension type to use for verification.
*/
template<typename U, typename D>
concept UnitOf =
Unit<U> &&
Dimension<D> &&
std::same_as<typename U::reference, typename dimension_unit<D>::reference>;
// Quantity, QuantityPoint
namespace detail {
template<typename T>
inline constexpr bool is_quantity = false;
template<typename T>
inline constexpr bool is_quantity_point = false;
} // namespace detail
/**
* @brief A concept matching all quantities in the library.
*
* Satisfied by all specializations of :class:`quantity`.
*/
template<typename T>
concept Quantity = detail::is_quantity<T>;
/**
* @brief A concept matching all quantity points in the library.
*
* Satisfied by all specializations of :class:`quantity_point`.
*/
template<typename T>
concept QuantityPoint = detail::is_quantity_point<T>;
// WrappedQuantity
namespace detail {
template<typename T>
inline constexpr bool is_wrapped_quantity = false;
template<typename T>
requires requires { typename T::value_type; }
inline constexpr bool is_wrapped_quantity<T> = Quantity<typename T::value_type> || is_wrapped_quantity<typename T::value_type>;
} // namespace detail
/**
* @brief A concept matching types that wrap quantity objects.
*
* Satisfied by all wrapper types that satisfy `Quantity<typename T::value_type>`
* recursively (i.e. `std::optional<si::length<si::metre>>`).
*/
template<typename T>
concept WrappedQuantity = detail::is_wrapped_quantity<T>;
// ScalableNumber
namespace detail {
template<typename T>
concept constructible_from_integral =
// construction from an integral type
std::constructible_from<T, std::int64_t> &&
// unit scaling
std::regular_invocable<std::multiplies<>, T, T> &&
std::regular_invocable<std::divides<>, T, T>;
template<typename T>
concept not_constructible_from_integral =
// not construction from an integral type
(!std::constructible_from<T, std::int64_t>) &&
// scaling by the value from ratio
std::regular_invocable<std::multiplies<>, T, std::int64_t> &&
std::regular_invocable<std::multiplies<>, std::int64_t, T>; // &&
// std::regular_invocable<std::divides<>, T, std::int64_t>; // TODO Uncomment when a bug in LA is fixed
} // namespace detail
/**
* @brief A concept matching non-Quantity types.
*
* Satisfied by types that satisfy `(!Quantity<T>) && (!WrappedQuantity<T>) && std::regular<T>`.
*/
template<typename T>
concept ScalableNumber =
(!Quantity<T>) &&
(!WrappedQuantity<T>) &&
std::regular<T> &&
(detail::constructible_from_integral<T> || detail::not_constructible_from_integral<T>);
} // namespace units

View File

@@ -22,7 +22,7 @@
#pragma once #pragma once
#include <units/concepts.h> #include <units/bits/basic_concepts.h>
#include <units/unit.h> #include <units/unit.h>
namespace units { namespace units {

View File

@@ -0,0 +1,60 @@
// The MIT License (MIT)
//
// Copyright (c) 2018 Mateusz Pusz
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#pragma once
#include <units/bits/dimension_op.h>
#include <units/bits/equivalent.h>
namespace units {
// DimensionOfT
namespace detail {
template<typename Dim, template<typename...> typename DimTemplate>
inline constexpr bool same_exponents_of = false;
template<Exponent... Es, template<typename...> typename DimTemplate>
inline constexpr bool same_exponents_of<unknown_dimension<Es...>, DimTemplate> = requires { typename DimTemplate<unknown_dimension<Es...>, unknown_coherent_unit, typename Es::dimension...>; } && std::same_as<exponent_list<Es...>, typename DimTemplate<unknown_dimension<Es...>, unknown_coherent_unit, typename Es::dimension...>::recipe>;
} // namespace detail
template<typename Dim, template<typename...> typename DimTemplate>
concept EquivalentUnknownDimensionOfT = Dimension<Dim> && is_derived_from_specialization_of<Dim, unknown_dimension> && detail::same_exponents_of<Dim, DimTemplate>;
template<typename Dim, template<typename...> typename DimTemplate>
concept DimensionOfT = Dimension<Dim> && (is_derived_from_specialization_of<Dim, DimTemplate>
#if DOWNCAST_MODE == 0
|| EquivalentUnknownDimensionOfT<Dim, DimTemplate>
#endif
);
// QuantityOfT
template<typename Q, template<typename...> typename DimTemplate>
concept QuantityOfT = Quantity<Q> && DimensionOfT<typename Q::dimension, DimTemplate>;
// QuantityOf
template<typename T, typename Dim>
concept QuantityOf = Quantity<T> && Dimension<Dim> && equivalent<typename T::dimension, Dim>;
} // namespace units

View File

@@ -22,268 +22,5 @@
#pragma once #pragma once
#include <units/bits/external/downcasting.h> #include <units/bits/basic_concepts.h>
#include <units/bits/external/fixed_string.h> #include <units/bits/quantity_of.h>
#include <units/bits/external/hacks.h>
#include <units/ratio.h>
#include <units/bits/external/type_traits.h>
#include <functional>
#include <cstdint>
#include <utility>
namespace units {
// PrefixFamily
struct prefix_family;
/**
* @brief A concept matching a prefix family
*
* Satisfied by all types derived from `prefix_family`
*/
template<typename T>
concept PrefixFamily = std::derived_from<T, prefix_family>;
// Prefix
namespace detail {
template<PrefixFamily PF, ratio R>
struct prefix_base;
template<PrefixFamily PF, ratio R>
void to_prefix_base(const volatile prefix_base<PF, R>*);
} // namespace detail
/**
* @brief A concept matching a symbol prefix
*
* Satisfied by all specializations of `prefix`.
*/
template<typename T>
concept Prefix = requires(const volatile T* t) { detail::to_prefix_base(t); };
/**
* @brief A concept matching unit's ratio
*
* Satisfied by all ratio values for which `R.num > 0` and `R.den > 0`.
*/
template<ratio R>
concept UnitRatio = R.num > 0 && R.den > 0;
// Unit
template<ratio R, typename U>
requires UnitRatio<R>
struct scaled_unit;
// TODO: Remove when P1985 accepted
namespace detail {
template<ratio R, typename U>
void to_base_scaled_unit(const volatile scaled_unit<R, U>*);
} // namespace detail
/**
* @brief A concept matching all unit types in the library
*
* Satisfied by all unit types derived from an specialization of :class:`scaled_unit`.
*/
template<typename T>
concept Unit = requires { detail::to_base_scaled_unit(std::declval<const volatile T*>()); };
// BaseDimension
template<basic_fixed_string Symbol, Unit U>
requires U::is_named
struct base_dimension;
namespace detail {
template<basic_fixed_string Symbol, typename U>
void to_base_base_dimension(const volatile base_dimension<Symbol, U>*);
} // namespace detail
/**
* @brief A concept matching all base dimensions in the library.
*
* Satisfied by all dimension types derived from an specialization of `base_dimension`.
*/
template<typename T>
concept BaseDimension = requires { detail::to_base_base_dimension(std::declval<const volatile T*>()); };
// Exponent
namespace detail {
template<typename T>
inline constexpr bool is_exponent = false;
} // namespace detail
/**
* @brief A concept matching dimension's exponents.
*
* Satisfied by all specializations of :class:`exponent`.
*/
template<typename T>
concept Exponent = detail::is_exponent<T>;
// DerivedDimension
namespace detail {
template<Exponent... Es>
requires (BaseDimension<typename Es::dimension> && ...)
struct derived_dimension_base;
} // namespace detail
/**
* @brief A concept matching all derived dimensions in the library.
*
* Satisfied by all dimension types derived from an specialization of `detail::derived_dimension_base`.
*/
template<typename T>
concept DerivedDimension = is_derived_from_specialization_of<T, detail::derived_dimension_base>;
// Dimension
/**
* @brief A concept matching all dimensions in the library.
*
* Satisfied by all dimension types for which either `BaseDimension<T>` or `DerivedDimension<T>` is `true`.
*/
template<typename T>
concept Dimension = BaseDimension<T> || DerivedDimension<T>;
// UnitOf
namespace detail {
template<Dimension D>
auto default_unit()
{
if constexpr (BaseDimension<D>)
return typename D::base_unit{};
else
return typename D::coherent_unit{};
}
} // namespace detail
/**
* @brief Returns a 'default' unit of the dimension
*
* Depending on the dimension type it returns a base unit (for base dimensions)
* or a coherent unit (in case of derived dimensions).
*
* @tparam D Dimension type to get the unit from.
*/
template<Dimension D>
using dimension_unit = decltype(detail::default_unit<D>());
// TODO: replace with the below code when VS catches up
// decltype([]{
// if constexpr (BaseDimension<D>)
// return TYPENAME D::base_unit{};
// else
// return TYPENAME D::coherent_unit{};
// }());
/**
* @brief A concept matching only units of a specified dimension.
*
* Satisfied by all unit types that satisfy `Unit<U>`, `Dimension<D>`, and for which
* `U::reference` and @c dimension_unit<D>::reference denote the same unit type.
*
* @tparam U Type to verify.
* @tparam D Dimension type to use for verification.
*/
template<typename U, typename D>
concept UnitOf =
Unit<U> &&
Dimension<D> &&
std::same_as<typename U::reference, typename dimension_unit<D>::reference>;
// Quantity, QuantityPoint
namespace detail {
template<typename T>
inline constexpr bool is_quantity = false;
template<typename T>
inline constexpr bool is_quantity_point = false;
} // namespace detail
/**
* @brief A concept matching all quantities in the library.
*
* Satisfied by all specializations of :class:`quantity`.
*/
template<typename T>
concept Quantity = detail::is_quantity<T>;
/**
* @brief A concept matching all quantity points in the library.
*
* Satisfied by all specializations of :class:`quantity_point`.
*/
template<typename T>
concept QuantityPoint = detail::is_quantity_point<T>;
// WrappedQuantity
namespace detail {
template<typename T>
inline constexpr bool is_wrapped_quantity = false;
template<typename T>
requires requires { typename T::value_type; }
inline constexpr bool is_wrapped_quantity<T> = Quantity<typename T::value_type> || is_wrapped_quantity<typename T::value_type>;
} // namespace detail
/**
* @brief A concept matching types that wrap quantity objects.
*
* Satisfied by all wrapper types that satisfy `Quantity<typename T::value_type>`
* recursively (i.e. `std::optional<si::length<si::metre>>`).
*/
template<typename T>
concept WrappedQuantity = detail::is_wrapped_quantity<T>;
// ScalableNumber
namespace detail {
template<typename T>
concept constructible_from_integral =
// construction from an integral type
std::constructible_from<T, std::int64_t> &&
// unit scaling
std::regular_invocable<std::multiplies<>, T, T> &&
std::regular_invocable<std::divides<>, T, T>;
template<typename T>
concept not_constructible_from_integral =
// not construction from an integral type
(!std::constructible_from<T, std::int64_t>) &&
// scaling by the value from ratio
std::regular_invocable<std::multiplies<>, T, std::int64_t> &&
std::regular_invocable<std::multiplies<>, std::int64_t, T>; // &&
// std::regular_invocable<std::divides<>, T, std::int64_t>; // TODO Uncomment when a bug in LA is fixed
} // namespace detail
/**
* @brief A concept matching non-Quantity types.
*
* Satisfied by types that satisfy `(!Quantity<T>) && (!WrappedQuantity<T>) && std::regular<T>`.
*/
template<typename T>
concept ScalableNumber =
(!Quantity<T>) &&
(!WrappedQuantity<T>) &&
std::regular<T> &&
(detail::constructible_from_integral<T> || detail::not_constructible_from_integral<T>);
} // namespace units

View File

@@ -32,6 +32,9 @@ struct radian : named_unit<radian, "rad", physical::si::prefix> {};
template<Unit U = radian> template<Unit U = radian>
struct dim_angle : base_dimension<"A", U> {}; struct dim_angle : base_dimension<"A", U> {};
template<typename T>
concept Angle = QuantityOfT<T, dim_angle>;
template<Unit U, ScalableNumber Rep = double> template<Unit U, ScalableNumber Rep = double>
using angle = quantity<dim_angle<>, U, Rep>; using angle = quantity<dim_angle<>, U, Rep>;

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/energy.h>
#include <units/physical/bits/mass.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_energy> E, DimensionOfT<dim_mass> M>
struct dim_absorbed_dose : derived_dimension<Child, U, exponent<E, 1>, exponent<M, -1>> {};
template<typename T>
concept AbsorbedDose = QuantityOfT<T, dim_absorbed_dose>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/length.h>
#include <units/physical/bits/time.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_length> L, DimensionOfT<dim_time> T>
struct dim_acceleration : derived_dimension<Child, U, exponent<L, 1>, exponent<T, -2>> {};
template<typename T>
concept Acceleration = QuantityOfT<T, dim_acceleration>;
} // namespace units::physical

View File

@@ -0,0 +1,35 @@
// 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/concepts.h>
namespace units::physical {
template<Unit U>
struct dim_amount_of_substance : base_dimension<"N", U> {};
template<typename T>
concept AmountOfSubstance = QuantityOfT<T, dim_amount_of_substance>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/generic/angle.h>
#include <units/concepts.h>
#include <units/physical/bits/time.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_angle> A, DimensionOfT<dim_time> T>
struct dim_angular_velocity : derived_dimension<Child, U, exponent<A, 1>, exponent<T, -1>> {};
template <typename T>
concept AngularVelocity = QuantityOfT<T, dim_angular_velocity>;
} // namespace units::physical

View File

@@ -0,0 +1,36 @@
// 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/concepts.h>
#include <units/physical/bits/length.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_length> L>
struct dim_area : derived_dimension<Child, U, exponent<L, 2>> {};
template<typename T>
concept Area = QuantityOfT<T, dim_area>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/electric_charge.h>
#include <units/physical/bits/voltage.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_electric_charge> C, DimensionOfT<dim_voltage> V>
struct dim_capacitance : derived_dimension<Child, U, exponent<C, 1>, exponent<V, -1>> {};
template<typename T>
concept Capacitance = QuantityOfT<T, dim_capacitance>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/physical/bits/amount_of_substance.h>
#include <units/concepts.h>
#include <units/physical/bits/time.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_time> T, DimensionOfT<dim_amount_of_substance> M>
struct dim_catalytic_activity : derived_dimension<Child, U, exponent<T, -1>, exponent<M, 1>> {};
template<typename T>
concept CatalyticActivity = QuantityOfT<T, dim_catalytic_activity>;
} // namespace units::physical

View File

@@ -0,0 +1,43 @@
// 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/concepts.h>
#include <units/physical/bits/electric_charge.h>
#include <units/physical/bits/length.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_electric_charge> Q, DimensionOfT<dim_length> L>
struct dim_charge_density : derived_dimension<Child, U, exponent<Q, 1>, exponent<L, -3>> {};
template<typename Child, Unit U, DimensionOfT<dim_electric_charge> Q, DimensionOfT<dim_length> L>
struct dim_surface_charge_density : derived_dimension<Child, U, exponent<Q, 1>, exponent<L, -2>> {};
template<typename T>
concept ChargeDensity = QuantityOfT<T, dim_charge_density>;
template<typename T>
concept SurfaceChargeDensity = QuantityOfT<T, dim_surface_charge_density>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/length.h>
#include <units/physical/bits/amount_of_substance.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_amount_of_substance> M, DimensionOfT<dim_length> L>
struct dim_concentration : derived_dimension<Child, U, exponent<M, 1>, exponent<L, -3>> {};
template<typename T>
concept Concentration = QuantityOfT<T, dim_concentration>;
} // namespace units::physical

View File

@@ -0,0 +1,36 @@
// 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/concepts.h>
#include <units/physical/bits/resistance.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_resistance> R>
struct dim_conductance : derived_dimension<Child, U, exponent<R, -1>> {};
template<typename T>
concept Conductance = QuantityOfT<T, dim_conductance>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/electric_current.h>
#include <units/physical/bits/length.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_electric_current> I, DimensionOfT<dim_length> L>
struct dim_current_density : derived_dimension<Child, U, exponent<I, 1>, exponent<L, -2>> {};
template<typename T>
concept CurrentDensity = QuantityOfT<T, dim_current_density>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/length.h>
#include <units/physical/bits/mass.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_mass> M, DimensionOfT<dim_length> L>
struct dim_density : derived_dimension<Child, U, exponent<M, 1>, exponent<L, -3>> {};
template<typename T>
concept Density = QuantityOfT<T, dim_density>;
} // namespace units::physical

View File

@@ -0,0 +1,73 @@
// 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/concepts.h>
#include <units/physical/bits/absorbed_dose.h>
#include <units/physical/bits/acceleration.h>
#include <units/physical/bits/amount_of_substance.h>
#include <units/physical/bits/angular_velocity.h>
#include <units/physical/bits/area.h>
#include <units/physical/bits/capacitance.h>
#include <units/physical/bits/catalytic_activity.h>
#include <units/physical/bits/charge_density.h>
#include <units/physical/bits/concentration.h>
#include <units/physical/bits/conductance.h>
#include <units/physical/bits/current_density.h>
#include <units/physical/bits/density.h>
#include <units/physical/bits/dimensions.h>
#include <units/physical/bits/dynamic_viscosity.h>
#include <units/physical/bits/electric_charge.h>
#include <units/physical/bits/electric_current.h>
#include <units/physical/bits/electric_field_strength.h>
#include <units/physical/bits/energy.h>
// TODO Add when downcasting issue is solved
// #include <units/physical/bits/energy_density.h>
#include <units/physical/bits/force.h>
#include <units/physical/bits/frequency.h>
#include <units/physical/bits/heat_capacity.h>
#include <units/physical/bits/inductance.h>
#include <units/physical/bits/length.h>
#include <units/physical/bits/luminance.h>
#include <units/physical/bits/luminous_intensity.h>
#include <units/physical/bits/magnetic_flux.h>
#include <units/physical/bits/magnetic_induction.h>
#include <units/physical/bits/mass.h>
#include <units/physical/bits/molar_energy.h>
#include <units/physical/bits/momentum.h>
#include <units/physical/bits/permeability.h>
#include <units/physical/bits/permittivity.h>
#include <units/physical/bits/power.h>
#include <units/physical/bits/pressure.h>
// TODO Add when downcasting issue is solved
// #include <units/physical/bits/radioactivity.h>
#include <units/physical/bits/resistance.h>
#include <units/physical/bits/speed.h>
#include <units/physical/bits/surface_tension.h>
#include <units/physical/bits/thermal_conductivity.h>
#include <units/physical/bits/thermodynamic_temperature.h>
#include <units/physical/bits/time.h>
#include <units/physical/bits/torque.h>
#include <units/physical/bits/voltage.h>
#include <units/physical/bits/volume.h>

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/pressure.h>
#include <units/physical/bits/time.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_pressure> P, DimensionOfT<dim_time> T>
struct dim_dynamic_viscosity : derived_dimension<Child, U, exponent<P, 1>, exponent<T, 1>> {};
template<typename T>
concept DynamicViscosity = QuantityOfT<T, dim_dynamic_viscosity>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/electric_current.h>
#include <units/physical/bits/time.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_time> T, DimensionOfT<dim_electric_current> C>
struct dim_electric_charge : derived_dimension<Child, U, exponent<T, 1>, exponent<C, 1>> {};
template<typename T>
concept ElectricCharge = QuantityOfT<T, dim_electric_charge>;
} // namespace units::physical

View File

@@ -0,0 +1,35 @@
// 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/concepts.h>
namespace units::physical {
template<Unit U>
struct dim_electric_current : base_dimension<"I", U> {};
template<typename T>
concept ElectricCurrent = QuantityOfT<T, dim_electric_current>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/length.h>
#include <units/physical/bits/voltage.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_voltage> V, DimensionOfT<dim_length> L>
struct dim_electric_field_strength : derived_dimension<Child, U, exponent<V, 1>, exponent<L, -1>> {};
template<typename T>
concept ElectricFieldStrength = QuantityOfT<T, dim_electric_field_strength>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/force.h>
#include <units/physical/bits/length.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_force> F, DimensionOfT<dim_length> L>
struct dim_energy : derived_dimension<Child, U, exponent<F, 1>, exponent<L, 1>> {};
template<typename T>
concept Energy = QuantityOfT<T, dim_energy>;
} // namespace units::physical

View File

@@ -0,0 +1,38 @@
// 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/concepts.h>
#include <units/physical/bits/energy.h>
#include <units/physical/bits/length.h>
namespace units::physical {
// TODO Add when downcasting issue is solved
// template<typename Child, Unit U, DimensionOfT<dim_energy> E, DimensionOfT<dim_length> L>
// struct dim_energy_density : derived_dimension<Child, U, exponent<E, 1>, exponent<L, -3>> {};
// template<typename T>
// concept EnergyDensity = QuantityOfT<T, dim_energy_density>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/physical/bits/acceleration.h>
#include <units/concepts.h>
#include <units/physical/bits/mass.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_mass> M, DimensionOfT<dim_acceleration> A>
struct dim_force : derived_dimension<Child, U, exponent<M, 1>, exponent<A, 1>> {};
template<typename T>
concept Force = QuantityOfT<T, dim_force>;
} // namespace units::physical

View File

@@ -0,0 +1,36 @@
// 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/concepts.h>
#include <units/physical/bits/time.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_time> T>
struct dim_frequency : derived_dimension<Child, U, exponent<T, -1>> {};
template<typename T>
concept Frequency = QuantityOfT<T, dim_frequency>;
} // namespace units::physical

View File

@@ -0,0 +1,51 @@
// 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/physical/bits/amount_of_substance.h>
#include <units/concepts.h>
#include <units/physical/bits/energy.h>
#include <units/physical/bits/mass.h>
#include <units/physical/bits/thermodynamic_temperature.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_energy> E, DimensionOfT<dim_thermodynamic_temperature> T>
struct dim_heat_capacity : derived_dimension<Child, U, exponent<E, 1>, exponent<T, -1>> {};
template<typename Child, Unit U, DimensionOfT<dim_heat_capacity> C, DimensionOfT<dim_mass> M>
struct dim_specific_heat_capacity : derived_dimension<Child, U, exponent<C, 1>, exponent<M, -1>> {};
template<typename Child, Unit U, DimensionOfT<dim_heat_capacity> C, DimensionOfT<dim_amount_of_substance> M>
struct dim_molar_heat_capacity : derived_dimension<Child, U, exponent<C, 1>, exponent<M, -1>> {};
template<typename T>
concept HeatCapacity = QuantityOfT<T, dim_heat_capacity>;
template<typename T>
concept SpecificHeatCapacity = QuantityOfT<T, dim_specific_heat_capacity>;
template<typename T>
concept MolarHeatCapacity = QuantityOfT<T, dim_molar_heat_capacity>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/electric_current.h>
#include <units/physical/bits/magnetic_flux.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_magnetic_flux> F, DimensionOfT<dim_electric_current> I>
struct dim_inductance : derived_dimension<Child, U, exponent<F, 1>, exponent<I, -1>> {};
template<typename T>
concept Inductance = QuantityOfT<T, dim_inductance>;
} // namespace units::physical

View File

@@ -0,0 +1,35 @@
// 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/concepts.h>
namespace units::physical {
template<Unit U>
struct dim_length : base_dimension<"L", U> {};
template<typename T>
concept Length = QuantityOfT<T, dim_length>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/luminous_intensity.h>
#include <units/physical/bits/length.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_luminous_intensity> I, DimensionOfT<dim_length> L>
struct dim_luminance : derived_dimension<Child, U, exponent<I, 1>, exponent<L, -2>> {};
template<typename T>
concept Luminance = QuantityOfT<T, dim_luminance>;
} // namespace units::physical

View File

@@ -0,0 +1,35 @@
// 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/concepts.h>
namespace units::physical {
template<Unit U>
struct dim_luminous_intensity : base_dimension<"J", U> {};
template<typename T>
concept LuminousIntensity = QuantityOfT<T, dim_luminous_intensity>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/physical/bits/area.h>
#include <units/concepts.h>
#include <units/physical/bits/magnetic_induction.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_magnetic_induction> B, DimensionOfT<dim_area> A>
struct dim_magnetic_flux : derived_dimension<Child, U, exponent<B, 1>, exponent<A, 1>> {};
template<typename T>
concept MagneticFlux = QuantityOfT<T, dim_magnetic_flux>;
} // namespace units::physical

View File

@@ -0,0 +1,38 @@
// 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/concepts.h>
#include <units/physical/bits/length.h>
#include <units/physical/bits/time.h>
#include <units/physical/bits/voltage.h>
namespace units::physical {
template <typename Child, Unit U, DimensionOfT<dim_voltage> V, DimensionOfT<dim_time> T, DimensionOfT<dim_length> L>
struct dim_magnetic_induction : derived_dimension<Child, U, exponent<V, 1>, exponent<T, 1>, exponent<L, -2>> {};
template<typename T>
concept MagneticInduction = QuantityOfT<T, dim_magnetic_induction>;
} // namespace units::physical

View File

@@ -0,0 +1,35 @@
// 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/concepts.h>
namespace units::physical {
template<Unit U>
struct dim_mass : base_dimension<"M", U> {};
template<typename T>
concept Mass = QuantityOfT<T, dim_mass>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/physical/bits/amount_of_substance.h>
#include <units/concepts.h>
#include <units/physical/bits/energy.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_energy> E, DimensionOfT<dim_amount_of_substance> M>
struct dim_molar_energy : derived_dimension<Child, U, exponent<E, 1>, exponent<M, -1>> {};
template<typename T>
concept MolarEnergy = QuantityOfT<T, dim_molar_energy>;
} // namespace units::physical

View File

@@ -0,0 +1,36 @@
// 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/concepts.h>
#include <units/physical/bits/speed.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_mass> M, DimensionOfT<dim_speed> V>
struct dim_momentum : derived_dimension<Child, U, exponent<M, 1>, exponent<V, 1>> {};
template<typename T>
concept Momentum = QuantityOfT<T, dim_momentum>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/inductance.h>
#include <units/physical/bits/length.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_inductance> H, DimensionOfT<dim_length> L>
struct dim_permeability : derived_dimension<Child, U, exponent<H, 1>, exponent<L, -1>> {};
template<typename T>
concept Permeability = QuantityOfT<T, dim_permeability>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/physical/bits/capacitance.h>
#include <units/concepts.h>
#include <units/physical/bits/length.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_capacitance> C, DimensionOfT<dim_length> L>
struct dim_permittivity : derived_dimension<Child, U, exponent<C, 1>, exponent<L, -1>> {};
template<typename T>
concept Permittivity = QuantityOfT<T, dim_permittivity>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/energy.h>
#include <units/physical/bits/time.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_energy> E, DimensionOfT<dim_time> T>
struct dim_power : derived_dimension<Child, U, exponent<E, 1>, exponent<T, -1>> {};
template<typename T>
concept Power = QuantityOfT<T, dim_power>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/physical/bits/area.h>
#include <units/concepts.h>
#include <units/physical/bits/force.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_force> F, DimensionOfT<dim_area> A>
struct dim_pressure : derived_dimension<Child, U, exponent<F, 1>, exponent<A, -1>> {};
template<typename T>
concept Pressure = QuantityOfT<T, dim_pressure>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/time.h>
namespace units::physical {
// TODO Add when downcasting issue is solved
// template<typename Child, Unit U, DimensionOfT<dim_time> T>
// struct dim_radioactivity : derived_dimension<Child, U, exponent<T, -1>> {};
// template<typename T>
// concept Radioactivity = QuantityOfT<T, dim_radioactivity>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/electric_current.h>
#include <units/physical/bits/voltage.h>
namespace units::physical {
template <typename Child, Unit U, DimensionOfT<dim_voltage> V, DimensionOfT<dim_electric_current> C>
struct dim_resistance : derived_dimension<Child,U, exponent<V, 1>, exponent<C, -1>> {};
template<typename T>
concept Resistance = QuantityOfT<T, dim_resistance>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/length.h>
#include <units/physical/bits/time.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_length> L, DimensionOfT<dim_time> T>
struct dim_speed : derived_dimension<Child, U, exponent<L, 1>, exponent<T, -1>> {};
template<typename T>
concept Speed = QuantityOfT<T, dim_speed>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/force.h>
#include <units/physical/bits/length.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_force> F, DimensionOfT<dim_length> L>
struct dim_surface_tension : derived_dimension<Child, U, exponent<F, 1>, exponent<L, -1>> {};
template<typename T>
concept SurfaceTension = QuantityOfT<T, dim_surface_tension>;
} // namespace units::physical

View File

@@ -0,0 +1,38 @@
// 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/concepts.h>
#include <units/physical/bits/length.h>
#include <units/physical/bits/power.h>
#include <units/physical/bits/thermodynamic_temperature.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_power> P, DimensionOfT<dim_length> L, DimensionOfT<dim_thermodynamic_temperature> T>
struct dim_thermal_conductivity : derived_dimension<Child, U, exponent<P, 1>, exponent<L, -1>, exponent<T, -1>> {};
template<typename T>
concept ThermalConductivity = QuantityOfT<T, dim_thermal_conductivity>;
} // namespace units::physical

View File

@@ -0,0 +1,35 @@
// 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/concepts.h>
namespace units::physical {
template<Unit U>
struct dim_thermodynamic_temperature : base_dimension<"Θ", U> {};
template<typename T>
concept ThermodynamicTemperature = QuantityOfT<T, dim_thermodynamic_temperature>;
} // namespace units::physical

View File

@@ -0,0 +1,35 @@
// 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/concepts.h>
namespace units::physical {
template<Unit U>
struct dim_time : base_dimension<"T", U> {};
template<typename T>
concept Time = QuantityOfT<T, dim_time>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/generic/angle.h>
#include <units/concepts.h>
#include <units/physical/bits/energy.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_energy> E, DimensionOfT<dim_angle> A>
struct dim_torque : derived_dimension<Child, U, exponent<E, 1>, exponent<A, 1>> {};
template<typename T>
concept Torque = QuantityOfT<T, dim_torque>;
} // namespace units::physical

View File

@@ -0,0 +1,37 @@
// 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/concepts.h>
#include <units/physical/bits/electric_current.h>
#include <units/physical/bits/power.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_power> P, DimensionOfT<dim_electric_current> C>
struct dim_voltage : derived_dimension<Child, U, exponent<P, 1>, exponent<C, -1>> {};
template<typename T>
concept Voltage = QuantityOfT<T, dim_voltage>;
} // namespace units::physical

View File

@@ -0,0 +1,36 @@
// 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/concepts.h>
#include <units/physical/bits/length.h>
namespace units::physical {
template<typename Child, Unit U, DimensionOfT<dim_length> L>
struct dim_volume : derived_dimension<Child, U, exponent<L, 3>> {};
template<typename T>
concept Volume = QuantityOfT<T, dim_volume>;
} // namespace units::physical

View File

@@ -22,327 +22,50 @@
#pragma once #pragma once
#include <units/base_dimension.h> #include <units/physical/bits/absorbed_dose.h>
#include <units/bits/dimension_op.h> #include <units/physical/bits/acceleration.h>
#include <units/bits/external/type_traits.h> #include <units/physical/bits/amount_of_substance.h>
#include <units/derived_dimension.h> #include <units/physical/bits/angular_velocity.h>
#include <units/exponent.h> #include <units/physical/bits/area.h>
#include <units/generic/angle.h> #include <units/physical/bits/capacitance.h>
#include <units/quantity.h> #include <units/physical/bits/catalytic_activity.h>
#include <units/unit.h> #include <units/physical/bits/charge_density.h>
#include <concepts> #include <units/physical/bits/concentration.h>
#include <units/physical/bits/conductance.h>
namespace units::physical { #include <units/physical/bits/current_density.h>
#include <units/physical/bits/density.h>
namespace detail { #include <units/physical/bits/dimensions.h>
#include <units/physical/bits/dynamic_viscosity.h>
template<typename Dim, template<typename...> typename DimTemplate> #include <units/physical/bits/electric_charge.h>
inline constexpr bool same_exponents_of = false; #include <units/physical/bits/electric_current.h>
#include <units/physical/bits/electric_field_strength.h>
template<Exponent... Es, template<typename...> typename DimTemplate> #include <units/physical/bits/energy.h>
inline constexpr bool same_exponents_of<unknown_dimension<Es...>, DimTemplate> = requires { typename DimTemplate<unknown_dimension<Es...>, unknown_coherent_unit, typename Es::dimension...>; } && std::same_as<exponent_list<Es...>, typename DimTemplate<unknown_dimension<Es...>, unknown_coherent_unit, typename Es::dimension...>::recipe>;
} // namespace detail
template<typename Dim, template<typename...> typename DimTemplate>
concept EquivalentUnknownDimensionOf = Dimension<Dim> && is_derived_from_specialization_of<Dim, unknown_dimension> && detail::same_exponents_of<Dim, DimTemplate>;
template<typename Dim, template<typename...> typename DimTemplate>
concept DimensionOf = Dimension<Dim> && (is_derived_from_specialization_of<Dim, DimTemplate>);// ||
// EquivalentUnknownDimensionOf<Dim, DimTemplate>);
template<typename Q, template<typename...> typename DimTemplate>
concept QuantityOf = Quantity<Q> && DimensionOf<typename Q::dimension, DimTemplate>;
// ------------------------ base dimensions -----------------------------
template<Unit U>
struct dim_length : base_dimension<"L", U> {};
template<Unit U>
struct dim_mass : base_dimension<"M", U> {};
template<Unit U>
struct dim_time : base_dimension<"T", U> {};
template<Unit U>
struct dim_electric_current : base_dimension<"I", U> {};
template<Unit U>
struct dim_thermodynamic_temperature : base_dimension<"Θ", U> {};
template<Unit U>
struct dim_substance : base_dimension<"N", U> {};
template<Unit U>
struct dim_luminous_intensity : base_dimension<"J", U> {};
// ------------------------ derived dimensions -----------------------------
template<typename Child, Unit U, DimensionOf<dim_angle> A, DimensionOf<dim_time> T>
struct dim_angular_velocity : derived_dimension<Child, U, exponent<A, 1>, exponent<T, -1>> {};
template<typename Child, Unit U, DimensionOf<dim_time> T>
struct dim_frequency : derived_dimension<Child, U, exponent<T, -1>> {};
template<typename Child, Unit U, DimensionOf<dim_length> L>
struct dim_area : derived_dimension<Child, U, exponent<L, 2>> {};
template<typename Child, Unit U, DimensionOf<dim_length> L>
struct dim_volume : derived_dimension<Child, U, exponent<L, 3>> {};
template<typename Child, Unit U, DimensionOf<dim_length> L, DimensionOf<dim_time> T>
struct dim_speed : derived_dimension<Child, U, exponent<L, 1>, exponent<T, -1>> {};
template<typename Child, Unit U, DimensionOf<dim_length> L, DimensionOf<dim_time> T>
struct dim_acceleration : derived_dimension<Child, U, exponent<L, 1>, exponent<T, -2>> {};
template<typename Child, Unit U, DimensionOf<dim_mass> M, DimensionOf<dim_acceleration> A>
struct dim_force : derived_dimension<Child, U, exponent<M, 1>, exponent<A, 1>> {};
template<typename Child, Unit U, DimensionOf<dim_mass> M, DimensionOf<dim_speed> V>
struct dim_momentum : derived_dimension<Child, U, exponent<M, 1>, exponent<V, 1>> {};
template<typename Child, Unit U, DimensionOf<dim_force> F, DimensionOf<dim_length> L>
struct dim_energy : derived_dimension<Child, U, exponent<F, 1>, exponent<L, 1>> {};
template<typename Child, Unit U, DimensionOf<dim_energy> E, DimensionOf<dim_angle> A>
struct dim_torque : derived_dimension<Child, U, exponent<E, 1>, exponent<A, 1>> {};
template<typename Child, Unit U, DimensionOf<dim_mass> M, DimensionOf<dim_length> L>
struct dim_density : derived_dimension<Child, U, exponent<M, 1>, exponent<L, -3>> {};
template<typename Child, Unit U, DimensionOf<dim_energy> E, DimensionOf<dim_time> T>
struct dim_power : derived_dimension<Child, U, exponent<E, 1>, exponent<T, -1>> {};
template<typename Child, Unit U, DimensionOf<dim_power> P, DimensionOf<dim_electric_current> C>
struct dim_voltage : derived_dimension<Child, U, exponent<P, 1>, exponent<C, -1>> {};
template <typename Child, Unit U, DimensionOf<dim_voltage> V, DimensionOf<dim_electric_current> C>
struct dim_resistance : derived_dimension<Child,U, exponent<V, 1>, exponent<C, -1>> {};
template<typename Child, Unit U, DimensionOf<dim_time> T, DimensionOf<dim_electric_current> C>
struct dim_electric_charge : derived_dimension<Child, U, exponent<T, 1>, exponent<C, 1>> {};
template<typename Child, Unit U, DimensionOf<dim_electric_charge> C, DimensionOf<dim_voltage> V>
struct dim_capacitance : derived_dimension<Child, U, exponent<C, 1>, exponent<V, -1>> {};
template<typename Child, Unit U, DimensionOf<dim_force> F, DimensionOf<dim_length> L>
struct dim_surface_tension : derived_dimension<Child, U, exponent<F, 1>, exponent<L, -1>> {};
template<typename Child, Unit U, DimensionOf<dim_force> F, DimensionOf<dim_area> A>
struct dim_pressure : derived_dimension<Child, U, exponent<F, 1>, exponent<A, -1>> {};
template <typename Child, Unit U, DimensionOf<dim_voltage> V, DimensionOf<dim_time> T, DimensionOf<dim_length> L>
struct dim_magnetic_induction : derived_dimension<Child, U, exponent<V, 1>, exponent<T, 1>, exponent<L, -2>> {};
template<typename Child, Unit U, DimensionOf<dim_magnetic_induction> B, DimensionOf<dim_area> A>
struct dim_magnetic_flux : derived_dimension<Child, U, exponent<B, 1>, exponent<A, 1>> {};
template<typename Child, Unit U, DimensionOf<dim_magnetic_flux> F, DimensionOf<dim_electric_current> I>
struct dim_inductance : derived_dimension<Child, U, exponent<F, 1>, exponent<I, -1>> {};
template<typename Child, Unit U, DimensionOf<dim_resistance> R>
struct dim_conductance : derived_dimension<Child, U, exponent<R, -1>> {};
// TODO Add when downcasting issue is solved // TODO Add when downcasting issue is solved
// template<typename Child, Unit U, DimensionOf<dim_time> T> // #include <units/physical/bits/energy_density.h>
// struct dim_radioactivity : derived_dimension<Child, U, exponent<T, -1>> {}; #include <units/physical/bits/force.h>
#include <units/physical/bits/frequency.h>
template<typename Child, Unit U, DimensionOf<dim_time> T, DimensionOf<dim_substance> M> #include <units/physical/bits/heat_capacity.h>
struct dim_catalytic_activity : derived_dimension<Child, U, exponent<T, -1>, exponent<M, 1>> {}; #include <units/physical/bits/inductance.h>
#include <units/physical/bits/length.h>
template<typename Child, Unit U, DimensionOf<dim_energy> E, DimensionOf<dim_mass> M> #include <units/physical/bits/luminance.h>
struct dim_absorbed_dose : derived_dimension<Child, U, exponent<E, 1>, exponent<M, -1>> {}; #include <units/physical/bits/luminous_intensity.h>
#include <units/physical/bits/magnetic_flux.h>
template<typename Child, Unit U, DimensionOf<dim_electric_current> I, DimensionOf<dim_length> L> #include <units/physical/bits/magnetic_induction.h>
struct dim_current_density : derived_dimension<Child, U, exponent<I, 1>, exponent<L, -2>> {}; #include <units/physical/bits/mass.h>
#include <units/physical/bits/molar_energy.h>
template<typename Child, Unit U, DimensionOf<dim_substance> M, DimensionOf<dim_length> L> #include <units/physical/bits/momentum.h>
struct dim_concentration : derived_dimension<Child, U, exponent<M, 1>, exponent<L, -3>> {}; #include <units/physical/bits/permeability.h>
#include <units/physical/bits/permittivity.h>
template<typename Child, Unit U, DimensionOf<dim_luminous_intensity> I, DimensionOf<dim_length> L> #include <units/physical/bits/power.h>
struct dim_luminance : derived_dimension<Child, U, exponent<I, 1>, exponent<L, -2>> {}; #include <units/physical/bits/pressure.h>
template<typename Child, Unit U, DimensionOf<dim_pressure> P, DimensionOf<dim_time> T>
struct dim_dynamic_viscosity : derived_dimension<Child, U, exponent<P, 1>, exponent<T, 1>> {};
template<typename Child, Unit U, DimensionOf<dim_energy> E, DimensionOf<dim_thermodynamic_temperature> T>
struct dim_heat_capacity : derived_dimension<Child, U, exponent<E, 1>, exponent<T, -1>> {};
template<typename Child, Unit U, DimensionOf<dim_heat_capacity> C, DimensionOf<dim_mass> M>
struct dim_specific_heat_capacity : derived_dimension<Child, U, exponent<C, 1>, exponent<M, -1>> {};
template<typename Child, Unit U, DimensionOf<dim_heat_capacity> C, DimensionOf<dim_substance> M>
struct dim_molar_heat_capacity : derived_dimension<Child, U, exponent<C, 1>, exponent<M, -1>> {};
template<typename Child, Unit U, DimensionOf<dim_power> P, DimensionOf<dim_length> L, DimensionOf<dim_thermodynamic_temperature> T>
struct dim_thermal_conductivity : derived_dimension<Child, U, exponent<P, 1>, exponent<L, -1>, exponent<T, -1>> {};
// TODO Add when downcasting issue is solved // TODO Add when downcasting issue is solved
// template<typename Child, Unit U, DimensionOf<dim_energy> E, DimensionOf<dim_length> L> // #include <units/physical/bits/radioactivity.h>
// struct dim_energy_density : derived_dimension<Child, U, exponent<E, 1>, exponent<L, -3>> {}; #include <units/physical/bits/resistance.h>
#include <units/physical/bits/speed.h>
template<typename Child, Unit U, DimensionOf<dim_voltage> V, DimensionOf<dim_length> L> #include <units/physical/bits/surface_tension.h>
struct dim_electric_field_strength : derived_dimension<Child, U, exponent<V, 1>, exponent<L, -1>> {}; #include <units/physical/bits/thermal_conductivity.h>
#include <units/physical/bits/thermodynamic_temperature.h>
template<typename Child, Unit U, DimensionOf<dim_electric_charge> Q, DimensionOf<dim_length> L> #include <units/physical/bits/time.h>
struct dim_charge_density : derived_dimension<Child, U, exponent<Q, 1>, exponent<L, -3>> {}; #include <units/physical/bits/torque.h>
#include <units/physical/bits/voltage.h>
template<typename Child, Unit U, DimensionOf<dim_electric_charge> Q, DimensionOf<dim_length> L> #include <units/physical/bits/volume.h>
struct dim_surface_charge_density : derived_dimension<Child, U, exponent<Q, 1>, exponent<L, -2>> {};
template<typename Child, Unit U, DimensionOf<dim_capacitance> C, DimensionOf<dim_length> L>
struct dim_permittivity : derived_dimension<Child, U, exponent<C, 1>, exponent<L, -1>> {};
template<typename Child, Unit U, DimensionOf<dim_inductance> H, DimensionOf<dim_length> L>
struct dim_permeability : derived_dimension<Child, U, exponent<H, 1>, exponent<L, -1>> {};
template<typename Child, Unit U, DimensionOf<dim_energy> E, DimensionOf<dim_substance> M>
struct dim_molar_energy : derived_dimension<Child, U, exponent<E, 1>, exponent<M, -1>> {};
template<typename T>
concept Length = QuantityOf<T, dim_length>;
template<typename T>
concept Mass = QuantityOf<T, dim_mass>;
template<typename T>
concept Time = QuantityOf<T, dim_time>;
template<typename T>
concept Current = QuantityOf<T, dim_electric_current>;
template<typename T>
concept Temperature = QuantityOf<T, dim_thermodynamic_temperature>;
template<typename T>
concept Substance = QuantityOf<T, dim_substance>;
template<typename T>
concept LuminousIntensity = QuantityOf<T, dim_luminous_intensity>;
template <typename T>
concept Angle = QuantityOf<T, dim_angle>;
template <typename T>
concept AngularVelocity = QuantityOf<T, dim_angular_velocity>;
template<typename T>
concept Frequency = QuantityOf<T, dim_frequency>;
template<typename T>
concept Area = QuantityOf<T, dim_area>;
template<typename T>
concept Volume = QuantityOf<T, dim_volume>;
template<typename T>
concept Speed = QuantityOf<T, dim_speed>;
template<typename T>
concept Acceleration = QuantityOf<T, dim_acceleration>;
template<typename T>
concept Force = QuantityOf<T, dim_force>;
template<typename T>
concept Momentum = QuantityOf<T, dim_momentum>;
template<typename T>
concept Energy = QuantityOf<T, dim_energy>;
template<typename T>
concept Torque = QuantityOf<T, dim_torque>;
template<typename T>
concept Density = QuantityOf<T, dim_density>;
template<typename T>
concept Power = QuantityOf<T, dim_power>;
template<typename T>
concept Voltage = QuantityOf<T, dim_voltage>;
template<typename T>
concept ElectricCharge = QuantityOf<T, dim_electric_charge>;
template<typename T>
concept Capacitance = QuantityOf<T, dim_capacitance>;
template<typename T>
concept SurfaceTension = QuantityOf<T, dim_surface_tension>;
template<typename T>
concept Pressure = QuantityOf<T, dim_pressure>;
template<typename T>
concept MagneticInduction = QuantityOf<T, dim_magnetic_induction>;
template<typename T>
concept MagneticFlux = QuantityOf<T, dim_magnetic_flux>;
template<typename T>
concept Inductance = QuantityOf<T, dim_inductance>;
template<typename T>
concept Conductance = QuantityOf<T, dim_conductance>;
// TODO Add when downcasting issue is solved
// template<typename T>
// concept Radioactivity = QuantityOf<T, dim_radioactivity>;
template<typename T>
concept CatalyticActivity = QuantityOf<T, dim_catalytic_activity>;
template<typename T>
concept AbsorbedDose = QuantityOf<T, dim_absorbed_dose>;
template<typename T>
concept CurrentDensity = QuantityOf<T, dim_current_density>;
template<typename T>
concept Concentration = QuantityOf<T, dim_concentration>;
template<typename T>
concept Luminance = QuantityOf<T, dim_luminance>;
template<typename T>
concept DynamicViscosity = QuantityOf<T, dim_dynamic_viscosity>;
template<typename T>
concept HeatCapacity = QuantityOf<T, dim_heat_capacity>;
template<typename T>
concept SpecificHeatCapacity = QuantityOf<T, dim_specific_heat_capacity>;
template<typename T>
concept MolarHeatCapacity = QuantityOf<T, dim_molar_heat_capacity>;
template<typename T>
concept ThermalConductivity = QuantityOf<T, dim_thermal_conductivity>;
// TODO Add when downcasting issue is solved
// template<typename T>
// concept EnergyDensity = QuantityOf<T, dim_energy_density>;
template<typename T>
concept ElectricFieldStrength = QuantityOf<T, dim_electric_field_strength>;
template<typename T>
concept ChargeDensity = QuantityOf<T, dim_charge_density>;
template<typename T>
concept SurfaceChargeDensity = QuantityOf<T, dim_surface_charge_density>;
template<typename T>
concept Permittivity = QuantityOf<T, dim_permittivity>;
template<typename T>
concept Permeability = QuantityOf<T, dim_permeability>;
template<typename T>
concept MolarEnergy = QuantityOf<T, dim_molar_energy>;
} // namespace units::physical

View File

@@ -30,16 +30,16 @@ namespace units::physical::si {
struct mole : named_unit<mole, "mol", prefix> {}; struct mole : named_unit<mole, "mol", prefix> {};
struct dim_substance : physical::dim_substance<mole> {}; struct dim_amount_of_substance : physical::dim_amount_of_substance<mole> {};
template<Unit U, ScalableNumber Rep = double> template<Unit U, ScalableNumber Rep = double>
using substance = quantity<dim_substance, U, Rep>; using amount_of_substance = quantity<dim_amount_of_substance, U, Rep>;
inline namespace literals { inline namespace literals {
// mol // mol
constexpr auto operator"" _q_mol(unsigned long long l) { return substance<mole, std::int64_t>(l); } constexpr auto operator"" _q_mol(unsigned long long l) { return amount_of_substance<mole, std::int64_t>(l); }
constexpr auto operator"" _q_mol(long double l) { return substance<mole, long double>(l); } constexpr auto operator"" _q_mol(long double l) { return amount_of_substance<mole, long double>(l); }
} // namespace literals } // namespace literals

View File

@@ -1,146 +0,0 @@
// The MIT License (MIT)
//
// Copyright (c) 2018 Mateusz Pusz
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#pragma once
#include <units/physical/dimensions.h>
#include <units/physical/si/prefixes.h>
#include <units/quantity.h>
namespace units::physical::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 : physical::dim_electric_current<ampere> {};
template<Unit U, ScalableNumber Rep = double>
using current = quantity<dim_electric_current, U, Rep>;
inline namespace literals {
// A
constexpr auto operator"" _q_A(unsigned long long l) { return current<ampere, std::int64_t>(l); }
constexpr auto operator"" _q_A(long double l) { return current<ampere, long double>(l); }
// yA
constexpr auto operator"" _q_yA(unsigned long long l) { return current<yoctoampere, std::int64_t>(l); }
constexpr auto operator"" _q_yA(long double l) { return current<yoctoampere, long double>(l); }
// zA
constexpr auto operator"" _q_zA(unsigned long long l) { return current<zeptoampere, std::int64_t>(l); }
constexpr auto operator"" _q_zA(long double l) { return current<zeptoampere, long double>(l); }
// aA
constexpr auto operator"" _q_aA(unsigned long long l) { return current<attoampere, std::int64_t>(l); }
constexpr auto operator"" _q_aA(long double l) { return current<attoampere, long double>(l); }
// fA
constexpr auto operator"" _q_fA(unsigned long long l) { return current<femtoampere, std::int64_t>(l); }
constexpr auto operator"" _q_fA(long double l) { return current<femtoampere, long double>(l); }
// pA
constexpr auto operator"" _q_pA(unsigned long long l) { return current<picoampere, std::int64_t>(l); }
constexpr auto operator"" _q_pA(long double l) { return current<picoampere, long double>(l); }
// nA
constexpr auto operator"" _q_nA(unsigned long long l) { return current<nanoampere, std::int64_t>(l); }
constexpr auto operator"" _q_nA(long double l) { return current<nanoampere, long double>(l); }
// uA
constexpr auto operator"" _q_uA(unsigned long long l) { return current<microampere, std::int64_t>(l); }
constexpr auto operator"" _q_uA(long double l) { return current<microampere, long double>(l); }
// mA
constexpr auto operator"" _q_mA(unsigned long long l) { return current<milliampere, std::int64_t>(l); }
constexpr auto operator"" _q_mA(long double l) { return current<milliampere, long double>(l); }
// cA
constexpr auto operator"" _q_cA(unsigned long long l) { return current<centiampere, std::int64_t>(l); }
constexpr auto operator"" _q_cA(long double l) { return current<centiampere, long double>(l); }
// dA
constexpr auto operator"" _q_dA(unsigned long long l) { return current<deciampere, std::int64_t>(l); }
constexpr auto operator"" _q_dA(long double l) { return current<deciampere, long double>(l); }
// daA
constexpr auto operator"" _q_daA(unsigned long long l) { return current<decaampere, std::int64_t>(l); }
constexpr auto operator"" _q_daA(long double l) { return current<decaampere, long double>(l); }
// hA
constexpr auto operator"" _q_hA(unsigned long long l) { return current<hectoampere, std::int64_t>(l); }
constexpr auto operator"" _q_hA(long double l) { return current<hectoampere, long double>(l); }
// kA
constexpr auto operator"" _q_kA(unsigned long long l) { return current<kiloampere, std::int64_t>(l); }
constexpr auto operator"" _q_kA(long double l) { return current<kiloampere, long double>(l); }
// MA
constexpr auto operator"" _q_MA(unsigned long long l) { return current<megaampere, std::int64_t>(l); }
constexpr auto operator"" _q_MA(long double l) { return current<megaampere, long double>(l); }
// GA
constexpr auto operator"" _q_GA(unsigned long long l) { return current<gigaampere, std::int64_t>(l); }
constexpr auto operator"" _q_GA(long double l) { return current<gigaampere, long double>(l); }
// TA
constexpr auto operator"" _q_TA(unsigned long long l) { return current<teraampere, std::int64_t>(l); }
constexpr auto operator"" _q_TA(long double l) { return current<teraampere, long double>(l); }
// PA
constexpr auto operator"" _q_PA(unsigned long long l) { return current<petaampere, std::int64_t>(l); }
constexpr auto operator"" _q_PA(long double l) { return current<petaampere, long double>(l); }
// EA
constexpr auto operator"" _q_EA(unsigned long long l) { return current<exaampere, std::int64_t>(l); }
constexpr auto operator"" _q_EA(long double l) { return current<exaampere, long double>(l); }
// ZA
constexpr auto operator"" _q_ZA(unsigned long long l) { return current<zettaampere, std::int64_t>(l); }
constexpr auto operator"" _q_ZA(long double l) { return current<zettaampere, long double>(l); }
// YA
constexpr auto operator"" _q_YA(unsigned long long l) { return current<yottaampere, std::int64_t>(l); }
constexpr auto operator"" _q_YA(long double l) { return current<yottaampere, long double>(l); }
} // namespace literals
} // namespace units::physical::si

View File

@@ -0,0 +1,146 @@
// 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/physical/dimensions.h>
#include <units/physical/si/prefixes.h>
#include <units/quantity.h>
namespace units::physical::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 : physical::dim_electric_current<ampere> {};
template<Unit U, ScalableNumber Rep = double>
using electric_current = quantity<dim_electric_current, U, Rep>;
inline namespace literals {
// A
constexpr auto operator"" _q_A(unsigned long long l) { return electric_current<ampere, 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) { return electric_current<yoctoampere, 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) { return electric_current<zeptoampere, 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) { return electric_current<attoampere, 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) { return electric_current<femtoampere, 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) { return electric_current<picoampere, 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) { return electric_current<nanoampere, 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) { return electric_current<microampere, 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) { return electric_current<milliampere, 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) { return electric_current<centiampere, 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) { return electric_current<deciampere, 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) { return electric_current<decaampere, 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) { return electric_current<hectoampere, 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) { return electric_current<kiloampere, 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) { return electric_current<megaampere, 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) { return electric_current<gigaampere, 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) { return electric_current<teraampere, 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) { return electric_current<petaampere, 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) { return electric_current<exaampere, 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) { return electric_current<zettaampere, 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) { return electric_current<yottaampere, std::int64_t>(l); }
constexpr auto operator"" _q_YA(long double l) { return electric_current<yottaampere, long double>(l); }
} // namespace literals
} // namespace units::physical::si

View File

@@ -32,13 +32,13 @@ struct kelvin : named_unit<kelvin, "K", no_prefix> {};
struct dim_thermodynamic_temperature : physical::dim_thermodynamic_temperature<kelvin> {}; struct dim_thermodynamic_temperature : physical::dim_thermodynamic_temperature<kelvin> {};
template<Unit U, ScalableNumber Rep = double> template<Unit U, ScalableNumber Rep = double>
using temperature = quantity<dim_thermodynamic_temperature, U, Rep>; using thermodynamic_temperature = quantity<dim_thermodynamic_temperature, U, Rep>;
inline namespace literals { inline namespace literals {
// K // K
constexpr auto operator"" _q_K(unsigned long long l) { return temperature<kelvin, std::int64_t>(l); } constexpr auto operator"" _q_K(unsigned long long l) { return thermodynamic_temperature<kelvin, std::int64_t>(l); }
constexpr auto operator"" _q_K(long double l) { return temperature<kelvin, long double>(l); } constexpr auto operator"" _q_K(long double l) { return thermodynamic_temperature<kelvin, long double>(l); }
} // namespace literals } // namespace literals

View File

@@ -29,7 +29,7 @@
#endif #endif
#include <units/physical/dimensions.h> #include <units/physical/dimensions.h>
#include <units/physical/si/base/substance.h> #include <units/physical/si/base/amount_of_substance.h>
#include <units/physical/si/base/time.h> #include <units/physical/si/base/time.h>
#include <units/physical/si/prefixes.h> #include <units/physical/si/prefixes.h>
#include <units/quantity.h> #include <units/quantity.h>
@@ -60,7 +60,7 @@ struct yottakatal : prefixed_unit<yottakatal, yotta, katal> {};
struct enzyme_unit : named_scaled_unit<enzyme_unit, "U", prefix, ratio(1, 60, -6), katal> {}; struct enzyme_unit : named_scaled_unit<enzyme_unit, "U", prefix, ratio(1, 60, -6), katal> {};
struct dim_catalytic_activity : physical::dim_catalytic_activity<dim_catalytic_activity, katal, dim_time, dim_substance> {}; struct dim_catalytic_activity : physical::dim_catalytic_activity<dim_catalytic_activity, katal, dim_time, dim_amount_of_substance> {};
template<Unit U, ScalableNumber Rep = double> template<Unit U, ScalableNumber Rep = double>
using catalytic_activity = quantity<dim_catalytic_activity, U, Rep>; using catalytic_activity = quantity<dim_catalytic_activity, U, Rep>;

View File

@@ -30,13 +30,13 @@
#include <units/physical/dimensions.h> #include <units/physical/dimensions.h>
#include <units/physical/si/base/length.h> #include <units/physical/si/base/length.h>
#include <units/physical/si/base/substance.h> #include <units/physical/si/base/amount_of_substance.h>
#include <units/quantity.h> #include <units/quantity.h>
namespace units::physical::si { namespace units::physical::si {
struct mol_per_metre_cub : unit<mol_per_metre_cub> {}; struct mol_per_metre_cub : unit<mol_per_metre_cub> {};
struct dim_concentration : physical::dim_concentration<dim_concentration, mol_per_metre_cub, dim_substance, dim_length> {}; struct dim_concentration : physical::dim_concentration<dim_concentration, mol_per_metre_cub, dim_amount_of_substance, dim_length> {};
template<Unit U, ScalableNumber Rep = double> template<Unit U, ScalableNumber Rep = double>
using concentration = quantity<dim_concentration, U, Rep>; using concentration = quantity<dim_concentration, U, Rep>;

View File

@@ -29,7 +29,7 @@
#endif #endif
#include <units/physical/dimensions.h> #include <units/physical/dimensions.h>
#include <units/physical/si/base/current.h> #include <units/physical/si/base/electric_current.h>
#include <units/physical/si/base/length.h> #include <units/physical/si/base/length.h>
#include <units/physical/si/prefixes.h> #include <units/physical/si/prefixes.h>
#include <units/quantity.h> #include <units/quantity.h>

View File

@@ -29,7 +29,7 @@
#endif #endif
#include <units/physical/dimensions.h> #include <units/physical/dimensions.h>
#include <units/physical/si/base/current.h> #include <units/physical/si/base/electric_current.h>
#include <units/physical/si/base/time.h> #include <units/physical/si/base/time.h>
#include <units/quantity.h> #include <units/quantity.h>

View File

@@ -29,10 +29,10 @@
#endif #endif
#include <units/physical/dimensions.h> #include <units/physical/dimensions.h>
#include <units/physical/si/base/temperature.h> #include <units/physical/si/base/thermodynamic_temperature.h>
#include <units/physical/si/bits/derived/energy.h> #include <units/physical/si/bits/derived/energy.h>
#include <units/physical/si/base/mass.h> #include <units/physical/si/base/mass.h>
#include <units/physical/si/base/substance.h> #include <units/physical/si/base/amount_of_substance.h>
#include <units/quantity.h> #include <units/quantity.h>
namespace units::physical::si { namespace units::physical::si {
@@ -43,7 +43,7 @@ struct joule_per_mole_kelvin : unit<joule_per_mole_kelvin> {};
struct dim_heat_capacity : physical::dim_heat_capacity<dim_heat_capacity, joule_per_kelvin, dim_energy, dim_thermodynamic_temperature> {}; struct dim_heat_capacity : physical::dim_heat_capacity<dim_heat_capacity, joule_per_kelvin, dim_energy, dim_thermodynamic_temperature> {};
struct dim_specific_heat_capacity : physical::dim_specific_heat_capacity<dim_specific_heat_capacity, joule_per_kilogram_kelvin, dim_heat_capacity, dim_mass> {}; struct dim_specific_heat_capacity : physical::dim_specific_heat_capacity<dim_specific_heat_capacity, joule_per_kilogram_kelvin, dim_heat_capacity, dim_mass> {};
struct dim_molar_heat_capacity : physical::dim_molar_heat_capacity<dim_molar_heat_capacity, joule_per_mole_kelvin, dim_heat_capacity, dim_substance> {}; struct dim_molar_heat_capacity : physical::dim_molar_heat_capacity<dim_molar_heat_capacity, joule_per_mole_kelvin, dim_heat_capacity, dim_amount_of_substance> {};
template<Unit U, ScalableNumber Rep = double> template<Unit U, ScalableNumber Rep = double>
using heat_capacity = quantity<dim_heat_capacity, U, Rep>; using heat_capacity = quantity<dim_heat_capacity, U, Rep>;

View File

@@ -30,7 +30,7 @@
#include <units/physical/dimensions.h> #include <units/physical/dimensions.h>
#include <units/physical/si/bits/derived/magnetic_flux.h> #include <units/physical/si/bits/derived/magnetic_flux.h>
#include <units/physical/si/base/current.h> #include <units/physical/si/base/electric_current.h>
#include <units/quantity.h> #include <units/quantity.h>
namespace units::physical::si { namespace units::physical::si {

View File

@@ -30,7 +30,7 @@
#include <units/physical/dimensions.h> #include <units/physical/dimensions.h>
#include <units/physical/si/bits/derived/energy.h> #include <units/physical/si/bits/derived/energy.h>
#include <units/physical/si/base/substance.h> #include <units/physical/si/base/amount_of_substance.h>
#include <units/physical/si/prefixes.h> #include <units/physical/si/prefixes.h>
#include <units/quantity.h> #include <units/quantity.h>
@@ -38,7 +38,7 @@ namespace units::physical::si {
struct joule_per_mole : unit<joule_per_mole> {}; struct joule_per_mole : unit<joule_per_mole> {};
struct dim_molar_energy : physical::dim_molar_energy<dim_molar_energy, joule_per_mole, dim_energy, dim_substance> {}; struct dim_molar_energy : physical::dim_molar_energy<dim_molar_energy, joule_per_mole, dim_energy, dim_amount_of_substance> {};
template<Unit U, ScalableNumber Rep = double> template<Unit U, ScalableNumber Rep = double>
using molar_energy = quantity<dim_molar_energy, U, Rep>; using molar_energy = quantity<dim_molar_energy, U, Rep>;

View File

@@ -30,7 +30,7 @@
#include <units/physical/dimensions.h> #include <units/physical/dimensions.h>
#include <units/physical/si/bits/derived/voltage.h> #include <units/physical/si/bits/derived/voltage.h>
#include <units/physical/si/base/current.h> #include <units/physical/si/base/electric_current.h>
#include <units/physical/si/prefixes.h> #include <units/physical/si/prefixes.h>
#include <units/quantity.h> #include <units/quantity.h>

View File

@@ -30,7 +30,7 @@
#include <units/physical/dimensions.h> #include <units/physical/dimensions.h>
#include <units/physical/si/bits/derived/power.h> #include <units/physical/si/bits/derived/power.h>
#include <units/physical/si/base/temperature.h> #include <units/physical/si/base/thermodynamic_temperature.h>
#include <units/quantity.h> #include <units/quantity.h>
namespace units::physical::si { namespace units::physical::si {

View File

@@ -29,7 +29,7 @@
#endif #endif
#include <units/physical/dimensions.h> #include <units/physical/dimensions.h>
#include <units/physical/si/base/current.h> #include <units/physical/si/base/electric_current.h>
#include <units/physical/si/bits/derived/power.h> #include <units/physical/si/bits/derived/power.h>
#include <units/physical/si/prefixes.h> #include <units/physical/si/prefixes.h>
#include <units/quantity.h> #include <units/quantity.h>

View File

@@ -24,12 +24,12 @@
#define MP_UNITS_SYSTEM_SI #define MP_UNITS_SYSTEM_SI
#include <units/physical/si/base/current.h> #include <units/physical/si/base/electric_current.h>
#include <units/physical/si/base/length.h> #include <units/physical/si/base/length.h>
#include <units/physical/si/base/luminous_intensity.h> #include <units/physical/si/base/luminous_intensity.h>
#include <units/physical/si/base/mass.h> #include <units/physical/si/base/mass.h>
#include <units/physical/si/base/substance.h> #include <units/physical/si/base/amount_of_substance.h>
#include <units/physical/si/base/temperature.h> #include <units/physical/si/base/thermodynamic_temperature.h>
#include <units/physical/si/base/time.h> #include <units/physical/si/base/time.h>
#include <units/physical/si/bits/derived/absorbed_dose.h> #include <units/physical/si/bits/derived/absorbed_dose.h>

View File

@@ -23,7 +23,7 @@
#pragma once #pragma once
#include <units/bits/external/downcasting.h> #include <units/bits/external/downcasting.h>
#include <units/concepts.h> #include <units/bits/basic_concepts.h>
#include <units/ratio.h> #include <units/ratio.h>
#include <units/symbol_text.h> #include <units/symbol_text.h>

View File

@@ -57,10 +57,6 @@ constexpr auto quantity_ratio(const quantity<D, U, Rep>&)
} // namespace detail } // namespace detail
// QuantityOf
template<typename T, typename Dim>
concept QuantityOf = Quantity<T> && Dimension<Dim> && equivalent<typename T::dimension, Dim>;
// quantity_cast // quantity_cast
namespace detail { namespace detail {