PrefixType renamed to PrefixFamily + units hierarchy PNG fixed
This commit is contained in:
1 parent
a9432b1407
commit
034f239f96
10 files changed
+146
-68
No files matched your search
@@ -29,11 +29,11 @@
|
||||
namespace units {
|
||||
|
||||
/**
|
||||
* @brief The base for all prefix types
|
||||
* @brief The base for all prefix families
|
||||
*
|
||||
* Every prefix type should inherit from this type to satisfy PrefixType concept.
|
||||
* Every prefix family should inherit from this type to satisfy PrefixFamily concept.
|
||||
*/
|
||||
struct prefix_type {};
|
||||
struct prefix_family {};
|
||||
|
||||
/**
|
||||
* @brief No prefix possible for the unit
|
||||
@@ -41,13 +41,13 @@ struct prefix_type {};
|
||||
* This is a special prefix type tag specifying that the unit can not be scaled with any kind
|
||||
* of the prefix.
|
||||
*/
|
||||
struct no_prefix : prefix_type {};
|
||||
struct no_prefix : prefix_family {};
|
||||
|
||||
namespace detail {
|
||||
|
||||
template<PrefixType PT, Ratio R>
|
||||
template<PrefixFamily PT, Ratio R>
|
||||
struct prefix_base : downcast_base<prefix_base<PT, R>> {
|
||||
using prefix_type = PT;
|
||||
using prefix_family = PT;
|
||||
using ratio = R;
|
||||
};
|
||||
|
||||
@@ -68,7 +68,7 @@ struct prefix_base : downcast_base<prefix_base<PT, R>> {
|
||||
* @tparam Symbol a text representation of the prefix
|
||||
* @tparam R factor to be used to scale a unit
|
||||
*/
|
||||
template<typename Child, PrefixType PT, basic_fixed_string Symbol, Ratio R>
|
||||
template<typename Child, PrefixFamily PT, basic_fixed_string Symbol, Ratio R>
|
||||
requires (!std::same_as<PT, no_prefix>)
|
||||
struct prefix : downcast_child<Child, detail::prefix_base<PT, R>> {
|
||||
static constexpr auto symbol = Symbol;
|
||||
|
||||
Reference in new issue
Block a user