Skip to content

Commit

Permalink
docs: example in the interop chapter updated to benefit from the `val…
Browse files Browse the repository at this point in the history
…ue_cast` for quantity points
  • Loading branch information
mpusz committed Dec 18, 2023
1 parent ce6db69 commit d12d865
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ std::chrono::sys_seconds ts_now = floor<seconds>(system_clock::now());
quantity_point start_time = ts_now;
quantity speed = 925. * km / h;
quantity distance = 8111. * km;
quantity flight_time = value_cast<int>((distance / speed).in(s));
quantity flight_time = distance / speed;
quantity_point exp_end_time = start_time + flight_time;

std::chrono::sys_seconds ts_end = exp_end_time;
std::chrono::sys_seconds ts_end = value_cast<int>(exp_end_time.in(s));

auto curr_time = zoned_time(current_zone(), ts_now);
auto mst_time = zoned_time("America/Denver", ts_end);
Expand All @@ -297,8 +297,6 @@ std::cout << "Takeoff: " << curr_time << "\n";
std::cout << "Landing: " << mst_time << "\n";
```
<!-- TODO fix the above to benefit from `value_cast` for `quantity_point` when implemented -->
The above may print the following output:
```cpp
Expand Down

0 comments on commit d12d865

Please sign in to comment.