diff --git a/include/fmt/format.h b/include/fmt/format.h index 5cccecf1..5fdc8bc2 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -73,10 +73,10 @@ # endif #endif // FMT_MODULE -#if (defined(__GNUC__) && __GNUC__ < 5) || defined(_MSC_VER) -# define OPERATOR_LITERAL(suffix) operator"" suffix +#if (defined(__GNUC__) && __GNUC__ < 5) +# define OPERATOR_LITERAL(suffix) operator"" _##suffix #else -# define OPERATOR_LITERAL(suffix) operator""suffix +# define OPERATOR_LITERAL(suffix) operator""_##suffix #endif #if defined(FMT_USE_NONTYPE_TEMPLATE_ARGS) @@ -4056,7 +4056,7 @@ template struct nested_formatter { inline namespace literals { #if FMT_USE_NONTYPE_TEMPLATE_ARGS -template constexpr auto OPERATOR_LITERAL(_a)() { +template constexpr auto OPERATOR_LITERAL(a)() { using char_t = remove_cvref_t; return detail::udl_arg(); } @@ -4069,7 +4069,7 @@ template constexpr auto OPERATOR_LITERAL(_a)() { * using namespace fmt::literals; * fmt::print("The answer is {answer}.", "answer"_a=42); */ -constexpr auto OPERATOR_LITERAL(_a)(const char* s, size_t) -> detail::udl_arg { +constexpr auto OPERATOR_LITERAL(a)(const char* s, size_t) -> detail::udl_arg { return {s}; } #endif // FMT_USE_NONTYPE_TEMPLATE_ARGS