diff --git a/fmt/format.h b/fmt/format.h index 30d77f99..c2244390 100644 --- a/fmt/format.h +++ b/fmt/format.h @@ -1211,7 +1211,7 @@ class value { custom_value custom; }; - typedef typename Context::char_type Char; + using char_type = typename Context::char_type; private: // The following two methods are private to disallow formatting of @@ -1229,12 +1229,12 @@ class value { // fmt::format("{}", L"test"); // To fix this, use a wide format string: fmt::format(L"{}", L"test"). #if !FMT_MSC_VER || defined(_NATIVE_WCHAR_T_DEFINED) - value(typename wchar_helper::unsupported); + value(typename wchar_helper::unsupported); #endif - value(typename wchar_helper::unsupported); - value(typename wchar_helper::unsupported); - value(typename wchar_helper::unsupported); - value(typename wchar_helper::unsupported); + value(typename wchar_helper::unsupported); + value(typename wchar_helper::unsupported); + value(typename wchar_helper::unsupported); + value(typename wchar_helper::unsupported); void set_string(string_view str) { this->string.value = str.data(); @@ -1249,8 +1249,8 @@ class value { // Formats an argument of a custom type, such as a user-defined class. template static void format_custom_arg( - basic_buffer &buffer, const void *arg, - basic_string_view &format, void *context) { + basic_buffer &buffer, const void *arg, + basic_string_view &format, void *context) { Context &ctx = *static_cast(context); // Get the formatter type through the context to allow different contexts // have different extension points, e.g. `formatter` for `format` and @@ -1305,16 +1305,16 @@ class value { FMT_MAKE_VALUE(char, int_value, CHAR) #if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) - typedef typename wchar_helper::supported WChar; + typedef typename wchar_helper::supported WChar; value(WChar value) { - static_assert(get_type() == internal::CHAR, "invalid type"); + static_assert(get_type() == CHAR, "invalid type"); this->int_value = value; } #endif #define FMT_MAKE_STR_VALUE(Type, TYPE) \ value(Type value) { \ - static_assert(get_type() == internal::TYPE, "invalid type"); \ + static_assert(get_type() == TYPE, "invalid type"); \ set_string(value); \ } @@ -1328,8 +1328,8 @@ class value { FMT_MAKE_STR_VALUE(string_view, STRING) #define FMT_MAKE_WSTR_VALUE(Type, TYPE) \ - value(typename wchar_helper::supported value) { \ - static_assert(get_type() == internal::TYPE, "invalid type"); \ + value(typename wchar_helper::supported value) { \ + static_assert(get_type() == TYPE, "invalid type"); \ set_string(value); \ } @@ -1345,7 +1345,7 @@ class value { template value(const T &value, typename std::enable_if::value, int>::type = 0) { - static_assert(get_type() == internal::CUSTOM, "invalid type"); + static_assert(get_type() == CUSTOM, "invalid type"); this->custom.value = &value; this->custom.format = &format_custom_arg; } @@ -1353,16 +1353,16 @@ class value { template value(const T &value, typename std::enable_if::value, int>::type = 0) { - static_assert(get_type() == internal::INT, "invalid type"); + static_assert(get_type() == INT, "invalid type"); this->int_value = value; } // Additional template param `Char_` is needed here because make_type always // uses char. - template - value(const named_arg &value) { + template + value(const named_arg &value) { static_assert( - get_type &>() == NAMED_ARG, "invalid type"); + get_type &>() == NAMED_ARG, "invalid type"); this->pointer = &value; } };