Skip to content

Commit

Permalink
Fix fmt deprecated char_traits<T> clang 18 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nx10 committed Jan 22, 2024
1 parent 15a62bd commit 21bd709
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions inst/include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -593,11 +593,11 @@ FMT_CONSTEXPR20 auto fill_n(T* out, Size count, char value) -> T* {
return out + count;
}

#ifdef __cpp_char8_t
using char8_type = char8_t;
#else
enum char8_type : unsigned char {};
#endif
//#ifdef __cpp_char8_t
using char8_type = char;
//#else
//enum char8_type : unsigned char {};
//#endif

template <typename OutChar, typename InputIt, typename OutputIt>
FMT_CONSTEXPR FMT_NOINLINE auto copy_str_noinline(InputIt begin, InputIt end,
Expand Down Expand Up @@ -734,10 +734,10 @@ FMT_CONSTEXPR inline auto compute_width(string_view s) -> size_t {
return num_code_points;
}

inline auto compute_width(basic_string_view<char8_type> s) -> size_t {
return compute_width(
string_view(reinterpret_cast<const char*>(s.data()), s.size()));
}
//inline auto compute_width(basic_string_view<char8_type> s) -> size_t {
// return compute_width(
// string_view(reinterpret_cast<const char*>(s.data()), s.size()));
//}

template <typename Char>
inline auto code_point_index(basic_string_view<Char> s, size_t n) -> size_t {
Expand All @@ -760,11 +760,11 @@ inline auto code_point_index(string_view s, size_t n) -> size_t {
return result;
}

inline auto code_point_index(basic_string_view<char8_type> s, size_t n)
-> size_t {
return code_point_index(
string_view(reinterpret_cast<const char*>(s.data()), s.size()), n);
}
//inline auto code_point_index(basic_string_view<char8_type> s, size_t n)
// -> size_t {
// return code_point_index(
// string_view(reinterpret_cast<const char*>(s.data()), s.size()), n);
//}

template <typename T> struct is_integral : std::is_integral<T> {};
template <> struct is_integral<int128_opt> : std::true_type {};
Expand Down

0 comments on commit 21bd709

Please sign in to comment.