Skip to content

Commit

Permalink
Update troubleshooting guide (#319)
Browse files Browse the repository at this point in the history
The biggest change is that we add a new section for the new kind of
error, when users try to pass something to a `QuantityMaker` even though
it's already a `Quantity` (and similar for `QuantityPoint`).

We also update the guidance to recommend `unblock_int_div` instead of
the obsolete `integer_quotient`.

Other than that, the PR basically consists of running the build under
the five configurations shown here, and copy-pasting error messages.
Most changes are just line number tweaks.  Some changed implementation
details do show up in the error messages.  Also, sometimes the compiler
changed to be more or less verbose.

The details of the changes aren't really important (assuming that I
copy-pasted correctly).  It's just an update.

Fixes #288.
  • Loading branch information
chiphogg authored Oct 31, 2024
1 parent f70d703 commit b6f05e3
Show file tree
Hide file tree
Showing 2 changed files with 580 additions and 320 deletions.
14 changes: 14 additions & 0 deletions au/error_examples.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ void example_private_constructor() {
constexpr QuantityD<Meters> length{5.5};
}

////////////////////////////////////////////////////////////////////////////////////////////////////
// SECTION: ...

void example_input_to_maker() {
constexpr auto x = meters(1);
constexpr auto x_pt = meters_pt(1);

// A (BROKEN): passing something that is already a quantity to a quantity maker.
meters(x);

// B (BROKEN): same as above, but with quantity _points_.
meters_pt(x_pt);
}

////////////////////////////////////////////////////////////////////////////////////////////////////
// SECTION: Dangerous conversion

Expand Down
Loading

0 comments on commit b6f05e3

Please sign in to comment.