xo-unit: refactor: push nu_maker into detail namespace
This commit is contained in:
parent
cb2b1c8b9e
commit
09f05f648f
2 changed files with 14 additions and 12 deletions
|
|
@ -33,16 +33,18 @@ namespace xo {
|
|||
}
|
||||
}
|
||||
|
||||
template <typename Int>
|
||||
struct nu_maker {
|
||||
template <typename... Ts>
|
||||
static constexpr natural_unit<Int>
|
||||
make_nu(Ts... args) {
|
||||
natural_unit<Int> bpu_array;
|
||||
detail::push_bpu_array(&bpu_array, args...);
|
||||
return bpu_array;
|
||||
}
|
||||
};
|
||||
namespace detail {
|
||||
template <typename Int>
|
||||
struct nu_maker {
|
||||
template <typename... Ts>
|
||||
static constexpr natural_unit<Int>
|
||||
make_nu(Ts... args) {
|
||||
natural_unit<Int> bpu_array;
|
||||
detail::push_bpu_array(&bpu_array, args...);
|
||||
return bpu_array;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/** @class natural_unit
|
||||
* @brief an array representing the cartesian product of distinct basis-power-units
|
||||
|
|
@ -64,7 +66,7 @@ namespace xo {
|
|||
constexpr natural_unit() : n_bpu_{0} {}
|
||||
|
||||
static constexpr natural_unit from_bu(basis_unit bu) {
|
||||
return nu_maker<Int>::make_nu(make_unit_power<Int>(bu));
|
||||
return detail::nu_maker<Int>::make_nu(make_unit_power<Int>(bu));
|
||||
}
|
||||
|
||||
constexpr std::size_t n_bpu() const { return n_bpu_; }
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ namespace xo {
|
|||
using xo::qty::detail::bpu2_rescale;
|
||||
using xo::qty::detail::bpu2_product;
|
||||
using xo::qty::natural_unit;
|
||||
using xo::qty::nu_maker;
|
||||
using xo::qty::detail::nu_maker;
|
||||
using xo::qty::detail::su_product;
|
||||
using xo::qty::detail::su_bpu_product;
|
||||
using xo::qty::detail::nu_ratio_inplace;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue