Skip to content

Commit

Permalink
Revert "Ensure that Rep is std::is_arithmetic (#104)" (#111)
Browse files Browse the repository at this point in the history
This reverts commit db8819c, which
breaks some code I hadn't been aware of in Aurora's repo.  It turns out
that a few people have started using non-arithmetic Rep already, and it
seems to be working out alright.

I also updated the documentation to reflect our "good" status here,
which I elaborated.  I think mp-units still gets "best" here, since they
have a well-defined concept for their Rep.

Fixes #38.
  • Loading branch information
chiphogg authored Feb 20, 2023
1 parent bacf892 commit 4e1c4a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 0 additions & 3 deletions au/quantity.hh
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ class Quantity {
using Unit = UnitT;
static constexpr auto unit = Unit{};

static_assert(std::is_arithmetic<Rep>::value,
"Rep must be built-in numeric type for now; see #52");

// IMPLICIT constructor for another Quantity of the same Dimension.
template <typename OtherUnit,
typename OtherRep,
Expand Down
11 changes: 7 additions & 4 deletions docs/alternatives/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -547,10 +547,13 @@ features.
<a href="https://mpusz.github.io/units/reference/core/concepts.html#_CPPv4I0EN5units14RepresentationE">Representation
concept</a>
</td>
<td class="fair">
Rep can only be <code>is_arithmetic</code> for now, but
<a href="https://github.com/aurora-opensource/au/issues/52">plan
to upgrade</a>
<td class="good">
<ul>
<li class="check">Mature support for <code>is_arithmetic</code> Rep</li>
<li class="check">Experimental support for custom Rep</li>
<li class="x">No constraints yet (<a
href="https://github.com/aurora-opensource/au/issues/52">#52</a>)</li>
</ul>
</td>
</tr>
<tr>
Expand Down

0 comments on commit 4e1c4a0

Please sign in to comment.