xo-unit: test: verify natural_unit/scaled_unit is structural type

This commit is contained in:
Roland Conybeare 2024-04-28 15:23:08 -04:00
commit a7af978e50
6 changed files with 84 additions and 5 deletions

View file

@ -122,7 +122,7 @@ namespace xo {
return retval;
}
private:
public: /* need public members so that a natural_unit instance can be a non-type template parameter (a structural type) */
/** @brief the number of occupied slots in @c bpu_v_ **/
std::size_t n_bpu_;

View file

@ -24,9 +24,9 @@ namespace xo {
{}
constexpr scaled_unit reciprocal() const {
return scaled_unit(nu_reciprocal(natural_unit_,
1 / outer_scale_factor_,
1.0 / outer_scale_sq_));
return scaled_unit(natural_unit_.reciprocal(),
1 / outer_scale_factor_,
1.0 / outer_scale_sq_);
}
natural_unit<Int> natural_unit_;