diff --git a/docs/framework.rst b/docs/framework.rst index e33e8d48..085e0692 100644 --- a/docs/framework.rst +++ b/docs/framework.rst @@ -13,6 +13,7 @@ Framework Basics framework/basic_concepts framework/quantities + framework/quantity_points framework/dimensions framework/units framework/constants diff --git a/docs/framework/quantity_points.rst b/docs/framework/quantity_points.rst new file mode 100644 index 00000000..158859b8 --- /dev/null +++ b/docs/framework/quantity_points.rst @@ -0,0 +1,38 @@ +.. namespace:: units + +Quantity Points +=============== + +A :term:`quantity point` is an absolute quantity with respect to zero +(which represents some origin) and is represented in the library with a +`quantity_point` class template. + + +Construction +------------ + +To create the quantity point object from a `quantity` we just have to pass +the value to the `quantity_point` class template explicit constructor:: + + quantity_point d(123q_km); + +.. note:: + + As the constructor is explicit, the quantity object can be created from + a quantity only via + `direct initialization `_. + This is why the code below using + `copy initialization `_ + **does not compile**:: + + quantity_point d = 123q_km; // ERROR + + +Differences to quantity +----------------------- + +Unlike `quantity`, the library provides +- no helper aliases for quantity points, such as `length_point`, +- no UDLs for quantity points, +- no dimension-specific concepts, such as `LengthPoint` + (there's the dimension-agnostic `QuantityPoint`), diff --git a/src/include/units/quantity_point.h b/src/include/units/quantity_point.h index 886ae87d..795148c5 100644 --- a/src/include/units/quantity_point.h +++ b/src/include/units/quantity_point.h @@ -30,8 +30,7 @@ namespace units { /** * @brief A quantity point * - * Property of a phenomenon, body, or substance, where the property has a magnitude that can be - * expressed by means of a number and a measurement unit. + * An absolute quantity with respect to zero (which represents some origin). * * @tparam D a dimension of the quantity point (can be either a BaseDimension or a DerivedDimension) * @tparam U a measurement unit of the quantity point