refactor: ♻️ exp_* operations on exponents renamed to `exponent_*
This commit is contained in:
1 parent
563b358d5e
commit
7ed4f19ef3
15 files changed
+85
-85
No files matched your search
@@ -84,21 +84,21 @@ namespace units {
|
||||
// exp_dim_id_less
|
||||
|
||||
template<Exponent E1, Exponent E2>
|
||||
struct exp_less : base_dimension_less<E1::dimension, E2::dimension> {
|
||||
struct exponent_less : base_dimension_less<E1::dimension, E2::dimension> {
|
||||
};
|
||||
|
||||
// exp_invert
|
||||
// exponent_invert
|
||||
|
||||
template<Exponent E>
|
||||
struct exp_invert;
|
||||
struct exponent_invert;
|
||||
|
||||
template<const base_dimension& BaseDimension, std::intmax_t Num, std::intmax_t Den>
|
||||
struct exp_invert<exponent<BaseDimension, Num, Den>> {
|
||||
struct exponent_invert<exponent<BaseDimension, Num, Den>> {
|
||||
using type = exponent<BaseDimension, -Num, Den>;
|
||||
};
|
||||
|
||||
template<Exponent E>
|
||||
using exp_invert_t = exp_invert<E>::type;
|
||||
using exponent_invert_t = exponent_invert<E>::type;
|
||||
|
||||
// dimension
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace units {
|
||||
struct dim_invert;
|
||||
|
||||
template<Exponent... Es>
|
||||
struct dim_invert<dimension<Es...>> : std::type_identity<downcast_traits_t<dimension<exp_invert_t<Es>...>>> {};
|
||||
struct dim_invert<dimension<Es...>> : std::type_identity<downcast_traits_t<dimension<exponent_invert_t<Es>...>>> {};
|
||||
|
||||
template<Dimension D>
|
||||
using dim_invert_t = dim_invert<typename D::downcast_base_type>::type;
|
||||
@@ -173,7 +173,7 @@ namespace units {
|
||||
|
||||
template<Exponent... Es>
|
||||
struct make_dimension {
|
||||
using type = detail::dim_consolidate_t<type_list_sort<dimension<Es...>, exp_less>>;
|
||||
using type = detail::dim_consolidate_t<type_list_sort<dimension<Es...>, exponent_less>>;
|
||||
};
|
||||
|
||||
template<Exponent... Es>
|
||||
@@ -181,7 +181,7 @@ namespace units {
|
||||
|
||||
template<Dimension D1, Dimension D2>
|
||||
struct merge_dimension {
|
||||
using type = detail::dim_consolidate_t<type_list_merge_sorted<D1, D2, exp_less>>;
|
||||
using type = detail::dim_consolidate_t<type_list_merge_sorted<D1, D2, exponent_less>>;
|
||||
};
|
||||
|
||||
template<Dimension D1, Dimension D2>
|
||||
@@ -205,7 +205,7 @@ namespace units {
|
||||
|
||||
template<Exponent... E1, Exponent... E2>
|
||||
struct dimension_divide<dimension<E1...>, dimension<E2...>>
|
||||
: dimension_multiply<dimension<E1...>, dimension<exp_invert_t<E2>...>> {
|
||||
: dimension_multiply<dimension<E1...>, dimension<exponent_invert_t<E2>...>> {
|
||||
};
|
||||
|
||||
template<Dimension D1, Dimension D2>
|
||||
|
||||
@@ -84,21 +84,21 @@ namespace units {
|
||||
// exp_dim_id_less
|
||||
|
||||
template<Exponent E1, Exponent E2>
|
||||
struct exp_less : base_dimension_less<E1::dimension, E2::dimension> {
|
||||
struct exponent_less : base_dimension_less<E1::dimension, E2::dimension> {
|
||||
};
|
||||
|
||||
// exp_invert
|
||||
// exponent_invert
|
||||
|
||||
template<Exponent E>
|
||||
struct exp_invert;
|
||||
struct exponent_invert;
|
||||
|
||||
template<const base_dimension& BaseDimension, std::intmax_t Num, std::intmax_t Den>
|
||||
struct exp_invert<exponent<BaseDimension, Num, Den>> {
|
||||
struct exponent_invert<exponent<BaseDimension, Num, Den>> {
|
||||
using type = exponent<BaseDimension, -Num, Den>;
|
||||
};
|
||||
|
||||
template<Exponent E>
|
||||
using exp_invert_t = exp_invert<E>::type;
|
||||
using exponent_invert_t = exponent_invert<E>::type;
|
||||
|
||||
// dimension
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace units {
|
||||
struct dim_invert;
|
||||
|
||||
template<typename... Es>
|
||||
struct dim_invert<dimension<Es...>> : std::type_identity<downcast_traits_t<dimension<exp_invert_t<Es>...>>> {};
|
||||
struct dim_invert<dimension<Es...>> : std::type_identity<downcast_traits_t<dimension<exponent_invert_t<Es>...>>> {};
|
||||
|
||||
template<Dimension D>
|
||||
using dim_invert_t = dim_invert<typename D::downcast_base_type>::type;
|
||||
@@ -173,7 +173,7 @@ namespace units {
|
||||
|
||||
template<Exponent... Es>
|
||||
struct make_dimension {
|
||||
using type = detail::dim_consolidate_t<type_list_sort<dimension<Es...>, exp_less>>;
|
||||
using type = detail::dim_consolidate_t<type_list_sort<dimension<Es...>, exponent_less>>;
|
||||
};
|
||||
|
||||
template<Exponent... Es>
|
||||
@@ -181,7 +181,7 @@ namespace units {
|
||||
|
||||
template<Dimension D1, Dimension D2>
|
||||
struct merge_dimension {
|
||||
using type = detail::dim_consolidate_t<type_list_merge_sorted<D1, D2, exp_less>>;
|
||||
using type = detail::dim_consolidate_t<type_list_merge_sorted<D1, D2, exponent_less>>;
|
||||
};
|
||||
|
||||
template<Dimension D1, Dimension D2>
|
||||
@@ -205,7 +205,7 @@ namespace units {
|
||||
|
||||
template<typename... E1, typename... E2>
|
||||
struct dimension_divide<dimension<E1...>, dimension<E2...>>
|
||||
: dimension_multiply<dimension<E1...>, dimension<exp_invert_t<E2>...>> {
|
||||
: dimension_multiply<dimension<E1...>, dimension<exponent_invert_t<E2>...>> {
|
||||
};
|
||||
|
||||
template<Dimension D1, Dimension D2>
|
||||
|
||||
@@ -72,21 +72,21 @@ namespace units {
|
||||
// exp_dim_id_less
|
||||
|
||||
template<typename E1, typename E2>
|
||||
struct exp_less : base_dimension_less<E1::dimension, E2::dimension> {
|
||||
struct exponent_less : base_dimension_less<E1::dimension, E2::dimension> {
|
||||
};
|
||||
|
||||
// exp_invert
|
||||
// exponent_invert
|
||||
|
||||
template<typename E>
|
||||
struct exp_invert;
|
||||
struct exponent_invert;
|
||||
|
||||
template<const base_dimension& BaseDimension, std::intmax_t Num, std::intmax_t Den>
|
||||
struct exp_invert<exponent<BaseDimension, Num, Den>> {
|
||||
struct exponent_invert<exponent<BaseDimension, Num, Den>> {
|
||||
using type = exponent<BaseDimension, -Num, Den>;
|
||||
};
|
||||
|
||||
template<typename E>
|
||||
using exp_invert_t = exp_invert<E>::type;
|
||||
using exponent_invert_t = exponent_invert<E>::type;
|
||||
|
||||
// dimension
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace units {
|
||||
struct dim_invert;
|
||||
|
||||
template<typename... Es>
|
||||
struct dim_invert<dimension<Es...>> : std::type_identity<downcast_traits_t<dimension<exp_invert_t<Es>...>>> {};
|
||||
struct dim_invert<dimension<Es...>> : std::type_identity<downcast_traits_t<dimension<exponent_invert_t<Es>...>>> {};
|
||||
|
||||
template<typename D>
|
||||
using dim_invert_t = dim_invert<typename D::downcast_base_type>::type;
|
||||
@@ -144,7 +144,7 @@ namespace units {
|
||||
|
||||
template<typename... Es>
|
||||
struct make_dimension {
|
||||
using type = detail::dim_consolidate_t<type_list_sort<dimension<Es...>, exp_less>>;
|
||||
using type = detail::dim_consolidate_t<type_list_sort<dimension<Es...>, exponent_less>>;
|
||||
};
|
||||
|
||||
template<typename... Es>
|
||||
@@ -152,7 +152,7 @@ namespace units {
|
||||
|
||||
template<typename D1, typename D2>
|
||||
struct merge_dimension {
|
||||
using type = detail::dim_consolidate_t<type_list_merge_sorted<D1, D2, exp_less>>;
|
||||
using type = detail::dim_consolidate_t<type_list_merge_sorted<D1, D2, exponent_less>>;
|
||||
};
|
||||
|
||||
template<typename D1, typename D2>
|
||||
@@ -176,7 +176,7 @@ namespace units {
|
||||
|
||||
template<typename... E1, typename... E2>
|
||||
struct dimension_divide<dimension<E1...>, dimension<E2...>>
|
||||
: dimension_multiply<dimension<E1...>, dimension<exp_invert_t<E2>...>> {
|
||||
: dimension_multiply<dimension<E1...>, dimension<exponent_invert_t<E2>...>> {
|
||||
};
|
||||
|
||||
template<typename D1, typename D2>
|
||||
|
||||
Reference in new issue
Block a user