Simplify byte handling

This commit is contained in:
Victor Zverovich
2022-02-02 16:13:24 -08:00
parent c7173a36a1
commit 35c0286cd8
2 changed files with 8 additions and 14 deletions
-11
View File
@@ -8,7 +8,6 @@
#ifndef FMT_CORE_H_
#define FMT_CORE_H_
#include <cstddef> // std::byte
#include <cstdio> // std::FILE
#include <cstring>
#include <iterator>
@@ -367,12 +366,6 @@ FMT_NORETURN FMT_API void assert_fail(const char* file, int line,
# endif
#endif
#ifdef __cpp_lib_byte
using byte = std::byte;
#else
enum class byte : unsigned char {};
#endif
#if defined(FMT_USE_STRING_VIEW)
template <typename Char> using std_string_view = std::basic_string_view<Char>;
#elif defined(FMT_USE_EXPERIMENTAL_STRING_VIEW)
@@ -1429,10 +1422,6 @@ template <typename Context> struct arg_mapper {
return map(format_as(val));
}
FMT_CONSTEXPR FMT_INLINE auto map(detail::byte val) -> unsigned {
return map(static_cast<unsigned char>(val));
}
template <typename T, typename U = remove_cvref_t<T>>
struct formattable
: bool_constant<has_const_formatter<U, Context>() ||