From 9988d9284cea127d1958f8ace2f987c931ad826f Mon Sep 17 00:00:00 2001 From: "Ralph J. Steinhagen" Date: Thu, 8 Apr 2021 09:54:44 +0200 Subject: [PATCH 1/3] adding missing/required (?) '#defines' for compiler-explorer examples N.B. The compiler explorer examples seem to miss to the following ``` #define UNITS_REFERENCES #define UNITS_LITERALS ``` defines to execute and recompile slightly modified versions. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9fb84f29..4cc245ff 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ static_assert(10 * km / (5 * km) == 2); static_assert(1000 / (1 * s) == 1 * kHz); ``` -_Try it on the [Compiler Explorer](https://godbolt.org/z/ToTaoxKPa)._ +_Try it on the [Compiler Explorer](https://godbolt.org/z/53bTahKd8)._ This library requires some C++20 features (concepts, classes as NTTPs, ...). Thanks to them the user gets a powerful but still easy to use interface and all unit conversions @@ -106,4 +106,4 @@ int main() } ``` -_Try it on the [Compiler Explorer](https://godbolt.org/z/YodshMKac)._ +_Try it on the [Compiler Explorer](https://godbolt.org/z/a956fb64o)._ From a05c1ca23c7884f54f9c3981e690259bbee37005 Mon Sep 17 00:00:00 2001 From: "Ralph J. Steinhagen" Date: Thu, 8 Apr 2021 13:21:37 +0200 Subject: [PATCH 2/3] adding missing/required (?) '#defines' for compiler-explorer examples - also in docs --- README.md | 1 + docs/quick_start.rst | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4cc245ff..57b96388 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ and dimensional analysis can be performed without sacrificing on accuracy. Pleas the below example for a quick preview of basic library features: ```cpp +#define UNITS_UDLS 1 #define UNITS_REFERENCES #define UNITS_LITERALS diff --git a/docs/quick_start.rst b/docs/quick_start.rst index 0170a96a..9b898eb2 100644 --- a/docs/quick_start.rst +++ b/docs/quick_start.rst @@ -34,7 +34,7 @@ Here is a small example of possible operations:: .. admonition:: Try it on Compiler Explorer - `Example #1 `_ + `Example #1 `_ This library requires some C++20 features (concepts, classes as :abbr:`NTTP (Non-Type Template Parameter)`, ...). Thanks to them the user gets a powerful @@ -42,6 +42,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_REFERENCES #define UNITS_LITERALS @@ -83,7 +84,7 @@ of basic library features:: .. admonition:: Try it on Compiler Explorer - `Example #2 `_ + `Example #2 `_ .. seealso:: From 3d5aed3969f97f1638358ccb1391999480351c58 Mon Sep 17 00:00:00 2001 From: "Ralph J. Steinhagen" Date: Thu, 8 Apr 2021 13:57:32 +0200 Subject: [PATCH 3/3] removed obsolete '#define UNITS_UDLS 1' --- README.md | 3 +-- docs/quick_start.rst | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 57b96388..b81025d1 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,6 @@ and dimensional analysis can be performed without sacrificing on accuracy. Pleas the below example for a quick preview of basic library features: ```cpp -#define UNITS_UDLS 1 #define UNITS_REFERENCES #define UNITS_LITERALS @@ -107,4 +106,4 @@ int main() } ``` -_Try it on the [Compiler Explorer](https://godbolt.org/z/a956fb64o)._ +_Try it on the [Compiler Explorer](https://godbolt.org/z/7sshE7o58)._ diff --git a/docs/quick_start.rst b/docs/quick_start.rst index 9b898eb2..faba09cd 100644 --- a/docs/quick_start.rst +++ b/docs/quick_start.rst @@ -42,7 +42,6 @@ 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_REFERENCES #define UNITS_LITERALS @@ -84,7 +83,7 @@ of basic library features:: .. admonition:: Try it on Compiler Explorer - `Example #2 `_ + `Example #2 `_ .. seealso::