diff --git a/doc/DESIGN.md b/doc/DESIGN.md index 02e9a9f7..98a5e888 100644 --- a/doc/DESIGN.md +++ b/doc/DESIGN.md @@ -688,21 +688,24 @@ In order to extend the library with custom dimensions the user has to: concept DigitalInformation = units::QuantityOf; ``` -4. If non-SI prefixes should be applied to the unit symbol, define a new prefix tag and provide - `prefix_symbol` specializations to provide their text representation: +4. If non-SI prefixes should be applied to the unit symbol, define a new prefix tag and define + new prefixes using this tag and provide their ratio and symbol: ```cpp struct data_prefix; - template<> inline constexpr std::string_view units::prefix_symbol> = "Ki"; - template<> inline constexpr std::string_view units::prefix_symbol> = "Mi"; + struct kibi : units::prefix, "Ki"> {}; + struct mebi : units::prefix, "Mi"> {}; ``` 5. Define units and register them to a downcasting facility: ```cpp struct bit : units::coherent_derived_unit {}; + struct kilobit : units::prefixed_derived_unit {}; + struct byte : units::derived_unit> {}; + struct kilobyte : units::prefixed_derived_unit {}; ``` 6. Provide user-defined literals for the most important units: