mirror of
https://github.com/mpusz/mp-units.git
synced 2026-01-25 08:32:21 +01:00
docs: tutorials renamed to use stable names
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Tutorial 10: Custom Base Dimensions
|
||||
|
||||
[Tutorial 7](tutorial_7.md) showed how to create strongly-typed dimensionless quantities
|
||||
[Tutorial 7](custom_dimensionless_units.md) showed how to create strongly-typed dimensionless quantities
|
||||
using custom units with `kind_of<dimensionless>` but no conversion factors between
|
||||
unrelated types. This approach works well for small-scale systems, but as complexity grows,
|
||||
custom base dimensions provide better separation and scalability.
|
||||
@@ -12,7 +12,7 @@ separate dimensions become necessary in large systems.
|
||||
|
||||
## Problem statement
|
||||
|
||||
In [Tutorial 7](tutorial_7.md), we created dimensionless units for `unit`, `carton`,
|
||||
In [Tutorial 7](custom_dimensionless_units.md), we created dimensionless units for `unit`, `carton`,
|
||||
and `truck`. These had no conversion factors between unrelated types, preventing mixing:
|
||||
|
||||
```cpp
|
||||
@@ -286,7 +286,7 @@ int main()
|
||||
|
||||
- [User's Guide: Systems of Quantities](../users_guide/framework_basics/systems_of_quantities.md)
|
||||
- [User's Guide: Systems of Units](../users_guide/framework_basics/systems_of_units.md)
|
||||
- [Tutorial 7: Custom Units for Dimensionless Counters](tutorial_7.md)
|
||||
- [Tutorial 7: Custom Units for Dimensionless Counters](custom_dimensionless_units.md)
|
||||
- [Examples: Currency](../examples/currency.md)
|
||||
|
||||
|
||||
@@ -298,7 +298,7 @@ int main()
|
||||
allows mixing all countable quantities, losing type safety in complex systems
|
||||
- **Progression of approaches**:
|
||||
- `dimensionless`: Simple, single-counter scenarios (loop iterations)
|
||||
- Custom units ([Tutorial 7](tutorial_7.md)): Unrelated dimensionless types (product units
|
||||
- Custom units ([Tutorial 7](custom_dimensionless_units.md)): Unrelated dimensionless types (product units
|
||||
vs trucks)
|
||||
- Custom dimensions (this tutorial): Fundamentally different domains requiring separate
|
||||
dimensions (_currencies_, _product counts_ vs _defect counts_)
|
||||
@@ -16,15 +16,15 @@ practical, type-safe patterns will help you apply **mp-units** in real projects.
|
||||
|
||||
## Learning Path
|
||||
|
||||
1. [Refactor to Strong Types](tutorial_1.md)
|
||||
2. [Refactor to Generic, Type-Safe Interfaces](tutorial_2.md)
|
||||
3. [Extracting Numeric Values](tutorial_3.md)
|
||||
4. [Working with Temperatures](tutorial_4.md)
|
||||
5. [Affine Spaces and Reference Origins](tutorial_5.md)
|
||||
6. [Interop with `std::chrono`](tutorial_6.md)
|
||||
7. [Custom Units for Dimensionless Counters](tutorial_7.md)
|
||||
8. [Typed Quantities of the Same Kind](tutorial_8.md)
|
||||
9. [Custom Quantity Specifications](tutorial_9.md)
|
||||
10. [Custom Base Dimensions](tutorial_10.md)
|
||||
11. [Preventing Confusion with Distinct Kinds](tutorial_11.md)
|
||||
12. [Faster-than-Lightspeed Constants](tutorial_12.md)
|
||||
1. [Refactor to Strong Types](refactor_to_strong_types.md)
|
||||
2. [Refactor to Generic, Type-Safe Interfaces](generic_type_safe_interfaces.md)
|
||||
3. [Extracting Numeric Values](extracting_numeric_values.md)
|
||||
4. [Working with Temperatures](working_with_temperatures.md)
|
||||
5. [Affine Spaces and Reference Origins](affine_spaces.md)
|
||||
6. [Interop with `std::chrono`](interop_with_std_chrono.md)
|
||||
7. [Custom Units for Dimensionless Counters](custom_dimensionless_units.md)
|
||||
8. [Typed Quantities of the Same Kind](typed_quantities_same_kind.md)
|
||||
9. [Custom Quantity Specifications](custom_quantity_specifications.md)
|
||||
10. [Custom Base Dimensions](custom_base_dimensions.md)
|
||||
11. [Preventing Confusion with Distinct Kinds](distinct_quantity_kinds.md)
|
||||
12. [Faster-than-Lightspeed Constants](faster_than_lightspeed_constants.md)
|
||||
|
||||
@@ -640,7 +640,7 @@ This pattern:
|
||||
|
||||
For a complete practical example demonstrating how `is_kind` prevents catastrophic
|
||||
engineering errors in hydraulic systems, see
|
||||
[Tutorial 11: Preventing Confusion with Distinct Kinds](../../tutorials/tutorial_11.md).
|
||||
[Tutorial 11: Preventing Confusion with Distinct Kinds](../../tutorials/distinct_quantity_kinds.md).
|
||||
|
||||
!!! note
|
||||
|
||||
|
||||
24
mkdocs.yml
24
mkdocs.yml
@@ -177,18 +177,18 @@ nav:
|
||||
- API Reference: api_reference.md
|
||||
- Tutorials:
|
||||
- Tutorials: tutorials/index.md
|
||||
- "Tutorial 1: Refactor to Strong Types": tutorials/tutorial_1.md
|
||||
- "Tutorial 2: Refactor to Generic, Type-Safe Interfaces": tutorials/tutorial_2.md
|
||||
- "Tutorial 3: Extracting Numeric Values": tutorials/tutorial_3.md
|
||||
- "Tutorial 4: Working with Temperatures": tutorials/tutorial_4.md
|
||||
- "Tutorial 5: Affine Spaces and Reference Origins": tutorials/tutorial_5.md
|
||||
- "Tutorial 6: Interop with std::chrono": tutorials/tutorial_6.md
|
||||
- "Tutorial 7: Custom Units for Dimensionless Counters": tutorials/tutorial_7.md
|
||||
- "Tutorial 8: Typed Quantities of the Same Kind": tutorials/tutorial_8.md
|
||||
- "Tutorial 9: Custom Quantity Specifications": tutorials/tutorial_9.md
|
||||
- "Tutorial 10: Custom Base Dimensions": tutorials/tutorial_10.md
|
||||
- "Tutorial 11: Preventing Confusion with Distinct Kinds": tutorials/tutorial_11.md
|
||||
- "Tutorial 12: Faster-than-Lightspeed Constants": tutorials/tutorial_12.md
|
||||
- "Tutorial 1: Refactor to Strong Types": tutorials/refactor_to_strong_types.md
|
||||
- "Tutorial 2: Refactor to Generic, Type-Safe Interfaces": tutorials/generic_type_safe_interfaces.md
|
||||
- "Tutorial 3: Extracting Numeric Values": tutorials/extracting_numeric_values.md
|
||||
- "Tutorial 4: Working with Temperatures": tutorials/working_with_temperatures.md
|
||||
- "Tutorial 5: Affine Spaces and Reference Origins": tutorials/affine_spaces.md
|
||||
- "Tutorial 6: Interop with std::chrono": tutorials/interop_with_std_chrono.md
|
||||
- "Tutorial 7: Custom Units for Dimensionless Counters": tutorials/custom_dimensionless_units.md
|
||||
- "Tutorial 8: Typed Quantities of the Same Kind": tutorials/typed_quantities_same_kind.md
|
||||
- "Tutorial 9: Custom Quantity Specifications": tutorials/custom_quantity_specifications.md
|
||||
- "Tutorial 10: Custom Base Dimensions": tutorials/custom_base_dimensions.md
|
||||
- "Tutorial 11: Preventing Confusion with Distinct Kinds": tutorials/distinct_quantity_kinds.md
|
||||
- "Tutorial 12: Faster-than-Lightspeed Constants": tutorials/faster_than_lightspeed_constants.md
|
||||
- Examples:
|
||||
- Examples: examples/index.md
|
||||
- Beginner:
|
||||
|
||||
Reference in New Issue
Block a user