From 2af2a28699a37d8fe961536c16fbc1fa78897566 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Thu, 11 Apr 2019 18:56:09 +0100 Subject: [PATCH] Design documentation updated with unit prefixes --- doc/DESIGN.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/doc/DESIGN.md b/doc/DESIGN.md index 723a40f2..b999338d 100644 --- a/doc/DESIGN.md +++ b/doc/DESIGN.md @@ -404,12 +404,25 @@ template concept Velocity = Quantity && std::Same; ``` -4. Define the base and secondary units and provide upcasting traits for them: +4. Define units and provide upcasting traits for them: + + - base unit ```cpp -struct meter_per_second : derived_unit {}; -template<> struct upcasting_traits> : upcast_to {}; +struct meter : unit> {}; +template<> struct upcasting_traits> : upcast_to {}; +``` + - units with prefixes + +```cpp +struct kilometer : kilo {}; +template<> struct upcasting_traits> : upcast_to {}; +``` + + - derived units + +```cpp struct kilometer_per_hour : derived_unit {}; template<> struct upcasting_traits> : upcast_to {}; ```