docs: example in the interop chapter updated to benefit from the value_cast for quantity points

This commit is contained in:
Mateusz Pusz
2023-12-18 16:41:42 +01:00
parent ce6db6950f
commit d12d865325

View File

@@ -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);
@@ -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