xo-unit: refactor: retire native_unit_id
This commit is contained in:
parent
1d175ee3f5
commit
0888b52ba1
1 changed files with 0 additions and 30 deletions
|
|
@ -44,36 +44,6 @@ namespace xo {
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr std::size_t n_dim = static_cast<std::size_t>(dim::n_dim);
|
static constexpr std::size_t n_dim = static_cast<std::size_t>(dim::n_dim);
|
||||||
|
|
||||||
enum class native_unit_id {
|
|
||||||
gram,
|
|
||||||
meter,
|
|
||||||
second,
|
|
||||||
currency,
|
|
||||||
price
|
|
||||||
};
|
|
||||||
|
|
||||||
template <dim Dim>
|
|
||||||
struct native_unit_for;
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct native_unit_for<dim::mass> { static constexpr auto value = native_unit_id::gram; };
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct native_unit_for<dim::distance> { static constexpr auto value = native_unit_id::meter; };
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct native_unit_for<dim::time> { static constexpr auto value = native_unit_id::second; };
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct native_unit_for<dim::currency> { static constexpr auto value = native_unit_id::currency; };
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct native_unit_for<dim::price> { static constexpr auto value = native_unit_id::price; };
|
|
||||||
|
|
||||||
template <dim Dim>
|
|
||||||
constexpr auto native_unit_for_v = native_unit_for<Dim>::value;
|
|
||||||
|
|
||||||
} /*namespace qty*/
|
} /*namespace qty*/
|
||||||
} /*namespace xo*/
|
} /*namespace xo*/
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue