mirror of
https://github.com/mpusz/mp-units.git
synced 2025-07-31 10:57:16 +02:00
Small documentation update
- default value for quantity representation
This commit is contained in:
@ -244,11 +244,11 @@ concept Quantity =
|
|||||||
detail::is_quantity<T>; // exposition only
|
detail::is_quantity<T>; // exposition only
|
||||||
```
|
```
|
||||||
|
|
||||||
`units::quantity` provides the interface really similar to `std::chrono::duration` with additional
|
`units::quantity` provides the interface really similar to `std::chrono::duration`. The difference is that
|
||||||
member types and functions as below:
|
it uses `double` as a default representation and has a few additional member types and functions as below:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template<Unit U, Scalar Rep>
|
template<Unit U, Scalar Rep = double>
|
||||||
class quantity {
|
class quantity {
|
||||||
public:
|
public:
|
||||||
using unit = U;
|
using unit = U;
|
||||||
@ -278,6 +278,8 @@ public:
|
|||||||
(ratio_divide<typename U1::ratio, typename U2::ratio>::den == 1))
|
(ratio_divide<typename U1::ratio, typename U2::ratio>::den == 1))
|
||||||
[[nodiscard]] constexpr Quantity operator/(const quantity<U1, Rep1>& lhs,
|
[[nodiscard]] constexpr Quantity operator/(const quantity<U1, Rep1>& lhs,
|
||||||
const quantity<U2, Rep2>& rhs);
|
const quantity<U2, Rep2>& rhs);
|
||||||
|
|
||||||
|
// ...
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user