Skip to content

Commit

Permalink
xo-unit: + Quantity.is_dimensionless()
Browse files Browse the repository at this point in the history
  • Loading branch information
Rconybea committed Apr 24, 2024
1 parent a00ca0b commit eb36c44
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion include/xo/unit/Quantity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ namespace xo {
constexpr const repr_type & scale() const { return scale_; }
constexpr const unit_type & unit() const { return unit_; }

constexpr Quantity unit_qty() const { return Quantity(1, unit_); }
constexpr bool is_dimensionless() const { return unit_.is_dimensionless(); }

constexpr Quantity unit_qty() const { return Quantity(1, unit_); }
constexpr Quantity reciprocal() const { return Quantity(1.0 / scale_, unit_.reciprocal()); }

template <typename Quantity2>
Expand Down
2 changes: 0 additions & 2 deletions utest/unit.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ namespace xo {
using xo::qty::detail::nu_ratio;
using xo::qty::unit_qty;

using xo::print::ccs;

template <typename T>
int unused()
{
Expand Down

0 comments on commit eb36c44

Please sign in to comment.