diff --git a/doc/DESIGN.md b/doc/DESIGN.md index e55ca77c..3dd57110 100644 --- a/doc/DESIGN.md +++ b/doc/DESIGN.md @@ -242,14 +242,14 @@ struct unit : downcast_base> { All units are created with a `derived_unit` helper: ```cpp -template +template struct derived_unit; ``` For example to define the base unit of `length`: ```cpp -struct metre : derived_unit {}; +struct metre : derived_unit {}; ``` Again, similarly to `derived_dimension`, the first class template parameter is a CRTP idiom used @@ -259,46 +259,46 @@ to provide downcasting facility (described below). - helper to create a base unit of a specified dimension ```cpp -template -struct derived_unit; +template +struct derived_unit; ``` ```cpp -struct metre : derived_unit {}; +struct metre : derived_unit {}; ``` - helper to create other units for a specified dimension ```cpp -template -struct derived_unit; +template +struct derived_unit; ``` ```cpp -struct yard : derived_unit> {}; +struct yard : derived_unit> {}; ``` - helper to create a unit with a SI prefix ```cpp -template -struct derived_unit; +template +struct derived_unit; ``` ```cpp -struct kilometre : derived_unit> {}; +struct kilometre : derived_unit> {}; ``` - helper that automatically calculates ratio based on info in desired dimension and provided list of units of base dimensions ```cpp -template -struct derived_unit; +template +struct derived_unit; ``` ```cpp -struct kilometre_per_hour : derived_unit {}; +struct kilometre_per_hour : derived_unit {}; ``` `units::Unit` is a concept that is satisfied by a type that is empty and publicly @@ -554,8 +554,8 @@ struct derived_dimension : downcast_helper -struct derived_unit : downcast_helper>> {}; +template +struct derived_unit : downcast_helper>> {}; ``` With such CRTP types the only thing the user has to do to register a new type to the downcasting @@ -563,7 +563,7 @@ facility is to publicly derive from one of those CRTP types and provide its new the first template parameter of the CRTP type. ```cpp -struct metre : derived_unit {}; +struct metre : derived_unit {}; ``` Above types are used to define base and target of a downcasting operation. To perform the actual @@ -644,8 +644,8 @@ In order to extend the library with custom dimensions the user has to: 4. Define units and register them to a downcasting facility: ```cpp - struct bit : units::derived_unit {}; - struct byte : units::derived_unit> {}; + struct bit : units::derived_unit {}; + struct byte : units::derived_unit> {}; ``` 5. Provide user-defined literals for the most important units: