diff --git a/code/include/cxx20format b/code/include/cxx20format new file mode 100644 index 0000000000000000000000000000000000000000..b880b297515df6efa9a034840f15dd300c8b87eb --- /dev/null +++ b/code/include/cxx20format @@ -0,0 +1,13 @@ +#include <version> +#ifdef __cpp_lib_format + #include<format> + namespace fmt = std; + using std::format; +#elif __has_include (<fmt/format.h>) + #define FMT_HEADER_ONLY + #include<fmt/core.h> + #include<fmt/format.h> + using fmt::format; + #warning Using external format.h header from the fmt library. +#endif + diff --git a/code/include/cxx20ranges b/code/include/cxx20ranges new file mode 100644 index 0000000000000000000000000000000000000000..989fe0678f4f85bb3e84064d75710094316f92fc --- /dev/null +++ b/code/include/cxx20ranges @@ -0,0 +1,14 @@ +#include <version> +#ifdef __cpp_lib_ranges + #include<ranges> + namespace sr = std::ranges; + namespace sv = std::views; +#elif __has_include (<range/v3/all.hpp>) + #include<range/v3/all.hpp> + namespace sr = ranges; + namespace sv = ranges::views; + #warning Using rangesv3 3rd party library +#else +#error No suitable header for C++20 ranges was found! +#endif +