refactor: UNITS_UDLS renamed to UNITS_LITERALS
Also now the existence of the preprocessor flag is enough to trigger the feature (`#ifdef` instead of `#if`)
This commit is contained in:
1 parent
a954f5d924
commit
c3659dbb47
92 files changed
+181
-185
No files matched your search
+1
-1
@@ -6,7 +6,7 @@
|
||||
- (!) refactor: Refactored the library file tree
|
||||
- (!) refactor: `quantity::count()` renamed to `quantity::number()`
|
||||
- (!) refactor: `data` system renamed to `isq::iec80000` (quantity names renamed too)
|
||||
- (!) refactor: quantity UDLs support has to be enabled with `UNITS_UDLS` preprocessor define
|
||||
- (!) refactor: quantity UDLs support has to be enabled with `UNITS_LITERALS` preprocessor define
|
||||
- refactor: quantity (kind) point updated to reflect latest changes to `quantity`
|
||||
- refactor: basic concepts, `quantity` and `quantity_cast` refactored
|
||||
- refactor: `abs()` definition refactored to be more explicit about the return type
|
||||
|
||||
@@ -87,7 +87,7 @@ User Defined Literals
|
||||
Alternatively, to construct quantities with compile-time known values the library provides
|
||||
:abbr:`UDL (User Defined Literal)` s for each :term:`unit` of every :term:`dimension`::
|
||||
|
||||
#if UNITS_UDLS
|
||||
#ifdef UNITS_LITERALS
|
||||
|
||||
inline namespace literals {
|
||||
|
||||
@@ -99,11 +99,11 @@ Alternatively, to construct quantities with compile-time known values the librar
|
||||
|
||||
}
|
||||
|
||||
#endif // UNITS_UDLS
|
||||
#endif // UNITS_LITERALS
|
||||
|
||||
Thanks to them the same code can be as simple as::
|
||||
|
||||
#define UNITS_UDLS 1
|
||||
#define UNITS_LITERALS
|
||||
|
||||
using namespace units::isq::si::literals;
|
||||
auto d = 123._q_km; // si::length<si::kilometre, long double>
|
||||
|
||||
@@ -40,7 +40,7 @@ but still easy to use interface where all unit conversions and dimensional analy
|
||||
performed without sacrificing on accuracy. Please see the below example for a quick preview
|
||||
of basic library features::
|
||||
|
||||
#define UNITS_UDLS 1
|
||||
#define UNITS_LITERALS
|
||||
|
||||
#include <units/format.h>
|
||||
#include <units/isq/si/length.h>
|
||||
|
||||
+5
-5
@@ -123,8 +123,8 @@ It also runs unit tests during Conan build.
|
||||
Conan Options
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
udls
|
||||
++++
|
||||
literals
|
||||
++++++++
|
||||
|
||||
**Values**: ``True``/``False``
|
||||
|
||||
@@ -158,14 +158,14 @@ Additionally, enables project documentation generation when the project is being
|
||||
CMake Options
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
UNITS_UDLS
|
||||
+++++++++++++++++++
|
||||
UNITS_LITERALS
|
||||
++++++++++++++
|
||||
|
||||
**Values**: ``ON``/``OFF``
|
||||
|
||||
**Defaulted to**: ``OFF``
|
||||
|
||||
Equivalent to `udls`_.
|
||||
Equivalent to `literals`_.
|
||||
|
||||
|
||||
UNITS_DOWNCAST_MODE
|
||||
|
||||
Reference in new issue
Block a user