From a80001c745cf04129b4a158fb109b84bf88529be Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Tue, 7 May 2019 21:54:23 -0600 Subject: [PATCH] units::common_quantity_t documentation added --- doc/DESIGN.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/DESIGN.md b/doc/DESIGN.md index b999338d..d36beaaf 100644 --- a/doc/DESIGN.md +++ b/doc/DESIGN.md @@ -261,6 +261,13 @@ public: Additional functions provide the support for operations that result in a different dimension type than those of their arguments. +Another change comparing to `std::chrono::duration` is that the `duration` is using +`std::common_type_t` to find a common representation for a calculation result. Such +a design was reported as problematic by numerics study group members as sometimes we want to provide +a different type in case of multiplication and different in case of division. `std::common_type` lacks +that additional information. That is why `units::quantity` uses the resulting type of a concrete operator +operation and provides it directly to `units::common_quantity_t` type trait. + #### `quantity_cast` To explicitly force truncating conversions `quantity_cast` function is provided which is a direct