forked from mpusz/mp-units
docs: "you" replaced to "we" in many places
This commit is contained in:
@@ -169,7 +169,7 @@ associated with this quantity type.
|
||||
as a vector or tensor quantity representation type.
|
||||
|
||||
To enable the usage of a user-defined type as a representation type for vector or tensor quantities,
|
||||
you need to provide a partial specialization of `is_vector` or `is_tensor` customization points.
|
||||
we need to provide a partial specialization of `is_vector` or `is_tensor` customization points.
|
||||
|
||||
For example, here is how it can be done for the [P1385](https://wg21.link/p1385) types:
|
||||
|
||||
@@ -223,12 +223,12 @@ either:
|
||||
|
||||
## Hacking the character
|
||||
|
||||
Sometimes you want to use a vector quantity, but you don't care about its direction. For example,
|
||||
the standard gravity acceleration constant always points down, so you might not care about this
|
||||
in a particular scenario. In such a case, you may want to "hack" the library to allow scalar types
|
||||
Sometimes we want to use a vector quantity, but we don't care about its direction. For example,
|
||||
the standard gravity acceleration constant always points down, so we might not care about this
|
||||
in a particular scenario. In such a case, we may want to "hack" the library to allow scalar types
|
||||
to be used as a representation type for scalar quantities.
|
||||
|
||||
For example, you can do the following:
|
||||
For example, we can do the following:
|
||||
|
||||
```cpp
|
||||
template<class T>
|
||||
|
||||
@@ -55,7 +55,7 @@ possible. For example, to create a quantity with a unit of speed, one may write:
|
||||
quantity<si::metre / si::second> q;
|
||||
```
|
||||
|
||||
In case you use such an unit often and would prefer to have a handy helper for it, you can
|
||||
In case we use such an unit often and would prefer to have a handy helper for it, we can
|
||||
always do something like this:
|
||||
|
||||
```cpp
|
||||
|
||||
@@ -116,9 +116,9 @@ error: could not convert 'mp_units::operator*<si::metre(), double, si::second(),
|
||||
|
||||
## Typed quantities
|
||||
|
||||
Simple mode is all about and just about units. In case you care about a specific quantity type,
|
||||
**typed quantities** should be preferred. With this mode, for example, you can specify if you
|
||||
deal with `width`, `height`, or `radius` and ensure you will not assign one to another by
|
||||
Simple mode is all about and just about units. In case we care about a specific quantity type,
|
||||
**typed quantities** should be preferred. With this mode, for example, we can specify if we
|
||||
deal with `width`, `height`, or `radius` and ensure we will not assign one to another by
|
||||
accident.
|
||||
|
||||
The previous example can be re-typed using typed quantities in the following way:
|
||||
|
||||
@@ -174,8 +174,8 @@ std::println("|{:*^10}|", 123 * m); // |**123 m***|
|
||||
|
||||
!!! note
|
||||
|
||||
[`std::println` is a C++23 facility](https://en.cppreference.com/w/cpp/io/print). In case you
|
||||
do not have access to C++23, you can obtain the same output with:
|
||||
[`std::println` is a C++23 facility](https://en.cppreference.com/w/cpp/io/print). In case we
|
||||
do not have access to C++23, we can obtain the same output with:
|
||||
|
||||
```cpp
|
||||
std::cout << std::format("<format-string>\n", <format-args>);
|
||||
|
||||
Reference in New Issue
Block a user