mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-02 11:54:27 +02:00
docs: Compiler Explorer link added to the smoot example
This commit is contained in:
@@ -13,6 +13,25 @@ include safety, performance, and developer experience.
|
|||||||
The library source code is hosted on [GitHub](https://github.com/mpusz/mp-units) with a permissive
|
The library source code is hosted on [GitHub](https://github.com/mpusz/mp-units) with a permissive
|
||||||
[MIT license](https://github.com/mpusz/units/blob/master/LICENSE.md).
|
[MIT license](https://github.com/mpusz/units/blob/master/LICENSE.md).
|
||||||
|
|
||||||
|
??? info "Supported compilers"
|
||||||
|
|
||||||
|
This library tries to provide the best user experience possible with the C++ language.
|
||||||
|
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](users_guide/framework_basics/systems_of_quantities.md#defining-quantities)
|
||||||
|
providing a backward-compatible way to use it.
|
||||||
|
|
||||||
|
As of today, the library compiles fine on the following compilers (or newer):
|
||||||
|
|
||||||
|
- gcc-11
|
||||||
|
- please note that we observed some ICEs on gcc-11
|
||||||
|
- no problems with gcc-12.2+
|
||||||
|
- clang-16
|
||||||
|
- apple-clang-15
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
#include <mp-units/ostream.h>
|
#include <mp-units/ostream.h>
|
||||||
@@ -37,6 +56,8 @@ Output:
|
|||||||
Harward Bridge length = 364.4 smoot(2034.57 ft, 620.136 m) +- an ear :-)
|
Harward Bridge length = 364.4 smoot(2034.57 ft, 620.136 m) +- an ear :-)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
!!! example "[Try it on Compiler Explorer](https://godbolt.org/z/T6Tx93Ysc)"
|
||||||
|
|
||||||
??? question "What is `smoot`?"
|
??? question "What is `smoot`?"
|
||||||
|
|
||||||
More on the `smoot` unit can be found at <https://units.fandom.com/wiki/Smoot>.
|
More on the `smoot` unit can be found at <https://units.fandom.com/wiki/Smoot>.
|
||||||
@@ -53,23 +74,3 @@ Harward Bridge length = 364.4 smoot(2034.57 ft, 620.136 m) +- an ear :-)
|
|||||||
- [P2982: `std::quantity` as a numeric type](https://wg21.link/p2982).
|
- [P2982: `std::quantity` as a numeric type](https://wg21.link/p2982).
|
||||||
|
|
||||||
We are actively looking for parties interested in field-trialing the library.
|
We are actively looking for parties interested in field-trialing the library.
|
||||||
|
|
||||||
??? info "Supported compilers"
|
|
||||||
|
|
||||||
This library tries to provide the best user experience possible with the C++ language.
|
|
||||||
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](users_guide/framework_basics/systems_of_quantities.md#defining-quantities)
|
|
||||||
providing a backward-compatible way to use it.
|
|
||||||
|
|
||||||
As of today, the library compiles fine on the following compilers (or newer):
|
|
||||||
|
|
||||||
- gcc-11
|
|
||||||
- please note that we observed some ICEs on gcc-11
|
|
||||||
- no problems with gcc-12.2+
|
|
||||||
- clang-16
|
|
||||||
- apple-clang-15
|
|
||||||
|
Reference in New Issue
Block a user