forked from mpusz/mp-units
style: whitespaces and formatting fixed to make pre-commit happy
This commit is contained in:
@@ -5,4 +5,4 @@ You're not viewing the latest version.
|
||||
<a href="{{ '../' ~ base_url }}">
|
||||
<strong>Click here to go to latest.</strong>
|
||||
</a>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -28,7 +28,7 @@ static_assert(1000 / (1 * s) == 1 * kHz);
|
||||
```
|
||||
|
||||
!!! example "[Try it on Compiler Explorer](https://godbolt.org/z/j8afKnarv)"
|
||||
|
||||
|
||||
|
||||
This library requires some C++20 features ([concepts and constraints](https://en.cppreference.com/w/cpp/language/constraints),
|
||||
[classes as NTTP](https://en.cppreference.com/w/cpp/language/template_parameters), ...). Thanks to them,
|
||||
|
||||
@@ -6,18 +6,18 @@
|
||||
To achieve that, it extensively uses C++20 features and the
|
||||
[explicit object parameter](https://en.cppreference.com/w/cpp/language/member_functions#Explicit_object_parameter)
|
||||
from C++23.
|
||||
|
||||
|
||||
Even though the library benefits from C++23 (if available), C++20 is enough to compile and
|
||||
use all of the library's functionality. C++23 features are hidden behind a preprocessor macro
|
||||
providing a backward-compatible way to use it.
|
||||
|
||||
|
||||
Sadly, as of today, not many compilers provide full C++20 support. The library compiles fine
|
||||
on the following compilers (or newer):
|
||||
|
||||
|
||||
- gcc-12.2
|
||||
|
||||
In the upcoming weeks, we will be actively working to extend the support to other compilers as well.
|
||||
|
||||
|
||||
|
||||
## Repository Structure and Dependencies
|
||||
|
||||
@@ -286,7 +286,7 @@ To obtain an official library release, the following steps may be performed:
|
||||
```ini title="conanfile.txt"
|
||||
[requires]
|
||||
mp-units/0.8.0
|
||||
|
||||
|
||||
[layout]
|
||||
cmake_layout
|
||||
|
||||
|
||||
@@ -73,4 +73,4 @@ auto speed = 60 * kmph;
|
||||
!!! note
|
||||
|
||||
In case you wonder why this library does not use UDLs to create quantities, please check
|
||||
our [FAQ](../faq/#why-dont-we-use-udls-to-create-quantities).
|
||||
our [FAQ](../faq/#why-dont-we-use-udls-to-create-quantities).
|
||||
|
||||
+3
-3
@@ -19,14 +19,14 @@ The library source code is hosted on [GitHub](https://github.com/mpusz/mp-units)
|
||||
To achieve that, it extensively uses C++20 features and the
|
||||
[explicit object parameter](https://en.cppreference.com/w/cpp/language/member_functions#Explicit_object_parameter)
|
||||
from C++23.
|
||||
|
||||
|
||||
Even though the library benefits from C++23 (if available), C++20 is enough to compile and
|
||||
use all of the library's functionality. C++23 features are hidden behind a preprocessor macro
|
||||
providing a backward-compatible way to use it.
|
||||
|
||||
|
||||
Sadly, as of today, only a few compilers provide full C++20 support. The library compiles fine
|
||||
on the following compilers (or newer):
|
||||
|
||||
|
||||
- gcc-12.2
|
||||
|
||||
In the upcoming weeks, we will be actively working to extend the support to other compilers as well.
|
||||
|
||||
@@ -185,22 +185,22 @@ Let's see another example:
|
||||
#include <mp-units/math.h>
|
||||
#include <mp-units/systems/si/si.h>
|
||||
#include <numbers>
|
||||
|
||||
|
||||
using namespace mp_units;
|
||||
|
||||
|
||||
class StorageTank {
|
||||
quantity<square(si::metre)> base_;
|
||||
quantity<si::metre> height_;
|
||||
public:
|
||||
constexpr StorageTank(const quantity<square(si::metre)>& base,
|
||||
constexpr StorageTank(const quantity<square(si::metre)>& base,
|
||||
const quantity<si::metre>& height) :
|
||||
base_(base), height_(height)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// ...
|
||||
};
|
||||
|
||||
|
||||
class CylindricalStorageTank : public StorageTank {
|
||||
public:
|
||||
constexpr CylindricalStorageTank(const quantity<si::metre>& radius,
|
||||
@@ -209,7 +209,7 @@ Let's see another example:
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class RectangularStorageTank : public StorageTank {
|
||||
public:
|
||||
constexpr RectangularStorageTank(const quantity<si::metre>& length,
|
||||
@@ -219,7 +219,7 @@ Let's see another example:
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace mp_units::si::unit_symbols;
|
||||
@@ -235,7 +235,7 @@ Let's see another example:
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
#include <mp-units/systems/si/si.h>
|
||||
#include <numbers>
|
||||
|
||||
|
||||
using namespace mp_units;
|
||||
using namespace mp_units::si::unit_symbols;
|
||||
|
||||
@@ -257,10 +257,10 @@ Let's see another example:
|
||||
base_(base), height_(height)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// ...
|
||||
};
|
||||
|
||||
|
||||
class CylindricalStorageTank : public StorageTank {
|
||||
public:
|
||||
constexpr CylindricalStorageTank(const quantity<isq::radius[m]>& radius,
|
||||
@@ -270,7 +270,7 @@ Let's see another example:
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class RectangularStorageTank : public StorageTank {
|
||||
public:
|
||||
constexpr RectangularStorageTank(const quantity<horizontal_length[m]>& length,
|
||||
@@ -280,7 +280,7 @@ Let's see another example:
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
auto tank = RectangularStorageTank(horizontal_length(1'000 * mm),
|
||||
|
||||
Reference in New Issue
Block a user