Remove dependency on <ranges>

This commit is contained in:
Victor Zverovich 2024-06-13 15:50:40 -07:00
parent 794df69c8c
commit e0b66e8f83

View File

@ -15,9 +15,6 @@
# include <tuple> # include <tuple>
# include <type_traits> # include <type_traits>
# include <utility> # include <utility>
# ifdef __cpp_lib_ranges
# include <ranges>
# endif
#endif #endif
#include "format.h" #include "format.h"
@ -622,15 +619,11 @@ struct formatter<
range_format::debug_string>> { range_format::debug_string>> {
private: private:
using range_type = detail::maybe_const_range<R>; using range_type = detail::maybe_const_range<R>;
#ifdef __cpp_lib_ranges
using string_type = conditional_t< using string_type = conditional_t<
std::is_constructible_v<std::basic_string_view<Char>, std::is_constructible<detail::std_string_view<Char>,
std::ranges::iterator_t<range_type>, decltype(detail::range_begin(R())),
std::ranges::sentinel_t<range_type>>, decltype(detail::range_end(R()))>::value,
std::basic_string_view<Char>, std::basic_string<Char>>; detail::std_string_view<Char>, std::basic_string<Char>>;
#else
using string_type = std::basic_string<Char>;
#endif
formatter<string_type, Char> underlying_; formatter<string_type, Char> underlying_;