mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-05 21:24:27 +02:00
docs: make_quantity
example added to "Quick Start" chapter
This commit is contained in:
@@ -39,6 +39,18 @@ auto q = 42 * m;
|
|||||||
why they are opt-in. A user has to explicitly "import" them from a dedicated `unit_symbols`
|
why they are opt-in. A user has to explicitly "import" them from a dedicated `unit_symbols`
|
||||||
namespace.
|
namespace.
|
||||||
|
|
||||||
|
In case someone doesn't like the multiply syntax or there is an ambiguity between `operator*`
|
||||||
|
provided by this and other libraries, a quantity can also be created with a dedicated factory
|
||||||
|
function:
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
#include <mp-units/systems/si/si.h>
|
||||||
|
|
||||||
|
using namespace mp_units;
|
||||||
|
|
||||||
|
auto q = make_quantity<si::metre>(42);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## User-provided unit wrappers
|
## User-provided unit wrappers
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user