mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 12:24:26 +02:00
feat: 💥 API-related Conan, CMake, and preprocessor options redesigned
This commit is contained in:
@@ -132,10 +132,15 @@ from such an instantiation.
|
||||
Quantity specification definitions benefit from an
|
||||
[explicit object parameter](https://en.cppreference.com/w/cpp/language/member_functions#Explicit_object_parameter)
|
||||
added in C++23 to remove the need for CRTP idiom, which significantly simplifies the code.
|
||||
However, as C++23 is far from being mainstream today, a portability macro `QUANTITY_SPEC()`
|
||||
However, as C++23 is far from being mainstream today,
|
||||
a [portability macro `QUANTITY_SPEC()`](../use_cases/wide_compatibility.md#QUANTITY_SPEC)
|
||||
is provided and used consistently through the library to allow the code to compile with C++20
|
||||
compilers, thanks to the CRTP usage under the hood.
|
||||
|
||||
See more in the
|
||||
[C++ compiler support](../../getting_started/cpp_compiler_support.md#explicit-this-parameter)
|
||||
chapter.
|
||||
|
||||
*[CRTP]: Curiously Recurring Template Parameter
|
||||
|
||||
For example, here is how the above quantity kind tree can be modeled in the library:
|
||||
|
Reference in New Issue
Block a user