forked from mpusz/mp-units
Custom representation types chapter updated
This commit is contained in:
@@ -50,7 +50,10 @@ Conversions of Quantities with Custom Representation Types
|
|||||||
----------------------------------------------------------
|
----------------------------------------------------------
|
||||||
|
|
||||||
Again let's assume two types but this time let's scope on converting operators rather
|
Again let's assume two types but this time let's scope on converting operators rather
|
||||||
than on constructors::
|
than on constructors:
|
||||||
|
|
||||||
|
.. code-block::
|
||||||
|
:emphasize-lines: 5, 13
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class impl {
|
class impl {
|
||||||
@@ -68,7 +71,7 @@ than on constructors::
|
|||||||
// the rest of the representation type implementation
|
// the rest of the representation type implementation
|
||||||
};
|
};
|
||||||
|
|
||||||
If we have instances of the above types we can construct quantities in the folLowing way::
|
If we have instances of the above types we can construct quantities in the following way::
|
||||||
|
|
||||||
impl<int> v_impl(1);
|
impl<int> v_impl(1);
|
||||||
expl<int> v_expl(1);
|
expl<int> v_expl(1);
|
||||||
@@ -96,4 +99,4 @@ Customization points
|
|||||||
.. seealso::
|
.. seealso::
|
||||||
|
|
||||||
For more examples of custom representation types usage please refer to
|
For more examples of custom representation types usage please refer to
|
||||||
:ref:`Linear Algebra of Quantities` chapter and `measurement` example.
|
:ref:`Linear Algebra of Quantities` chapter and :ref:`measurement` example.
|
Reference in New Issue
Block a user