removed base_prefix_family from unit classes, added PrefixFamily template argument to alias_unit

This commit is contained in:
Ramzi Sabra authored and Mateusz Pusz committed 2020-05-08 10:41:38 +02:00
1 parent 17ce8d3dc8
commit 2f6ecb113a
4 files changed
+6 -13

No files matched your search

+3 -10
View File
@@ -74,7 +74,6 @@ template<typename Child>
struct unit : downcast_child<Child, scaled_unit<ratio<1>, Child>> {
static constexpr bool is_named = false;
using prefix_family = no_prefix;
using base_prefix_family = no_prefix;
};
/**
@@ -101,7 +100,6 @@ struct named_unit : downcast_child<Child, scaled_unit<ratio<1>, Child>> {
static constexpr bool is_named = true;
static constexpr auto symbol = Symbol;
using prefix_family = PT;
using base_prefix_family = PT;
};
/**
@@ -123,7 +121,6 @@ struct named_scaled_unit : downcast_child<Child, scaled_unit<ratio_multiply<R, t
static constexpr bool is_named = true;
static constexpr auto symbol = Symbol;
using prefix_family = PT;
using base_prefix_family = PT;
};
/**
@@ -144,7 +141,6 @@ struct prefixed_unit :
static constexpr bool is_named = true;
static constexpr auto symbol = P::symbol + U::symbol;
using prefix_family = no_prefix;
using base_prefix_family = U::base_prefix_family;
};
/**
@@ -167,7 +163,6 @@ struct deduced_unit : downcast_child<Child, detail::deduced_unit<Dim, U, URest..
static constexpr bool is_named = false;
static constexpr auto symbol = detail::deduced_symbol_text<Dim, U, URest...>();
using prefix_family = no_prefix;
using base_prefix_family = U::base_prefix_family;
};
// template<typename Child, Dimension Dim, basic_fixed_string Symbol, PrefixFamily PT, Unit U, Unit... Us>
@@ -177,20 +172,18 @@ struct deduced_unit : downcast_child<Child, detail::deduced_unit<Dim, U, URest..
// using prefix_family = PT;
// };
template<Unit U, basic_symbol_text Symbol>
template<Unit U, basic_symbol_text Symbol, PrefixFamily PT>
struct alias_unit : U {
static constexpr bool is_named = true;
static constexpr auto symbol = Symbol;
using prefix_family = U::base_prefix_family;
using base_prefix_family = U::base_prefix_family;
using prefix_family = PT;
};
template<Unit U, Prefix P, Unit AU>
struct prefixed_alias_unit : U {
static constexpr bool is_named = true;
static constexpr auto symbol = P::symbol + AU::symbol;
using prefix_family = no_prefix;
using base_prefix_family = AU::base_prefix_family;
using prefix_family = AU::prefix_family;
};
} // namespace units