Repository: fmtlib/fmt
File: include/fmt/base.h (C/C++)

Code before:
                                     std::is_same<T, char16_t>::value ||
                                     std::is_same<T, char32_t>::value) &&
                                        !std::is_same<T, char_type>::value,
                                    int> = 0>
  FMT_MAP_API auto map(T) -> unformattable_char {
    return {};
  }

  FMT_MAP_API auto map(float val) -> float { return val; }
  FMT_MAP_API auto map(double val) -> double { return val; }
  FMT_MAP_API auto map(long double val) -> long double { return val; }

#if FMT_USE_BITINT
#  pragma clang diagnostic push
#  pragma clang diagnostic ignored "-Wbit-int-extension"
  template <class T, int N = 0> struct is_bitint : std::false_type {};
  template <int N> struct is_bitint<_BitInt(N)> : std::true_type {};
  template <int N> struct is_bitint<unsigned _BitInt(N)> : std::true_type {};

  template <class T, FMT_ENABLE_IF(is_bitint<remove_cvref_t<T>>::value)>
  FMT_MAP_API auto map(T&& val) -> decltype(val) {
    return val;
  }
#  pragma clang diagnostic pop
#endif

  FMT_MAP_API auto map(char_type* val) -> const char_type* { return val; }
  FMT_MAP_API auto map(const char_type* val) -> const char_type* { return val; }
  template <typename T, typename Char = char_t<T>,
            FMT_ENABLE_IF(std::is_same<Char, char_type>::value &&
                          !std::is_pointer<T>::value)>
  FMT_MAP_API auto map(const T& val) -> basic_string_view<Char> {
    return to_string_view(val);
  }
  template <typename T, typename Char = char_t<T>,
            FMT_ENABLE_IF(!std::is_same<Char, char_type>::value &&
                          !std::is_pointer<T>::value)>
  FMT_MAP_API auto map(const T&) -> unformattable_char {
    return {};
  }

  FMT_MAP_API auto map(void* val) -> const void* { return val; }
  FMT_MAP_API auto map(const void* val) -> const void* { return val; }
  FMT_MAP_API auto map(volatile void* val) -> const void* {
    return const_cast<const void*>(val);
  }
  FMT_MAP_API auto map(const volatile void* val) -> const void* {
    return const_cast<const void*>(val);
  }
  FMT_MAP_API auto map(std::nullptr_t val) -> const void* { return val; }


Review comment (suggestion):
`_BitInt` should be converted to appropriate integer type.

Code after:
  FMT_MAP_API auto map(bool val) -> bool { return val; }

  template <typename T, FMT_ENABLE_IF(std::is_same<T, char>::value ||
                                      std::is_same<T, char_type>::value)>
  FMT_MAP_API auto map(T val) -> char_type {
    return val;
  }
  template <typename T, enable_if_t<(std::is_same<T, wchar_t>::value ||
#ifdef __cpp_char8_t
                                     std::is_same<T, char8_t>::value ||
#endif
                                     std::is_same<T, char16_t>::value ||
                                     std::is_same<T, char32_t>::value) &&
                                        !std::is_same<T, char_type>::value,
                                    int> = 0>
  FMT_MAP_API auto map(T) -> unformattable_char {
    return {};
  }

  FMT_MAP_API auto map(float val) -> float { return val; }
  FMT_MAP_API auto map(double val) -> double { return val; }
  FMT_MAP_API auto map(long double val) -> long double { return val; }

  template <class T,
            FMT_ENABLE_IF(bitint_traits<remove_cvref_t<T>>::is_formattable)>
  FMT_MAP_API auto map(T&& val) -> decltype(val) {
    return val;
  }
  template <class T,
            FMT_ENABLE_IF(!bitint_traits<remove_cvref_t<T>>::is_formattable)>
  FMT_MAP_API auto map(T&&) -> unformattable {
    return {};
  }

  FMT_MAP_API auto map(char_type* val) -> const char_type* { return val; }
  FMT_MAP_API auto map(const char_type* val) -> const char_type* { return val; }
  template <typename T, typename Char = char_t<T>,
            FMT_ENABLE_IF(std::is_same<Char, char_type>::value &&
                          !std::is_pointer<T>::value)>
  FMT_MAP_API auto map(const T& val) -> basic_string_view<Char> {
    return to_string_view(val);
  }
  template <typename T, typename Char = char_t<T>,
            FMT_ENABLE_IF(!std::is_same<Char, char_type>::value &&
                          !std::is_pointer<T>::value)>
  FMT_MAP_API auto map(const T&) -> unformattable_char {
    return {};
  }

  FMT_MAP_API auto map(void* val) -> const void* { return val; }
  FMT_MAP_API auto map(const void* val) -> const void* { return val; }