From 77fb8da70e9bddc11a2f78b64238e21905cd7256 Mon Sep 17 00:00:00 2001 From: Darius Neatu Date: Wed, 19 Jun 2024 08:49:17 +0300 Subject: [PATCH] Add guards for --- include/Beman/Optional26/optional.hpp | 3 ++- src/Beman/Optional26/tests/optional_range_support.t.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/Beman/Optional26/optional.hpp b/include/Beman/Optional26/optional.hpp index 3f369e6d..4758632a 100644 --- a/include/Beman/Optional26/optional.hpp +++ b/include/Beman/Optional26/optional.hpp @@ -165,7 +165,9 @@ namespace std { */ #include +#if defined(__cpp_lib_format_ranges) #include +#endif #include #include #include @@ -214,7 +216,6 @@ template inline constexpr bool ranges::enable_borrowed_range> = true; // Since P3168R1: Give std::optional Range Support. -// TODO: Always enable when all major compilers implement P2585R1: "Improve default container formatting". #if defined(__cpp_lib_format_ranges) template inline constexpr auto format_kind> = range_format::disabled; diff --git a/src/Beman/Optional26/tests/optional_range_support.t.cpp b/src/Beman/Optional26/tests/optional_range_support.t.cpp index aa2623e6..b58d4c39 100644 --- a/src/Beman/Optional26/tests/optional_range_support.t.cpp +++ b/src/Beman/Optional26/tests/optional_range_support.t.cpp @@ -8,7 +8,9 @@ #include #include +#if defined(__cpp_lib_format_ranges) #include +#endif #include #include #include