mirror of
https://github.com/fmtlib/fmt.git
synced 2025-09-09 12:42:38 -04:00
fix OPERATOR_LITERAL marco bug for gcc7 compiler
This commit is contained in:
parent
f40f93a40d
commit
2fa816a1a8
@ -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 <typename T, typename Char = char> struct nested_formatter {
|
||||
|
||||
inline namespace literals {
|
||||
#if FMT_USE_NONTYPE_TEMPLATE_ARGS
|
||||
template <detail::fixed_string S> constexpr auto OPERATOR_LITERAL(_a)() {
|
||||
template <detail::fixed_string S> constexpr auto OPERATOR_LITERAL(a)() {
|
||||
using char_t = remove_cvref_t<decltype(*S.data)>;
|
||||
return detail::udl_arg<char_t, sizeof(S.data) / sizeof(char_t), S>();
|
||||
}
|
||||
@ -4069,7 +4069,7 @@ template <detail::fixed_string S> 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<char> {
|
||||
constexpr auto OPERATOR_LITERAL(a)(const char* s, size_t) -> detail::udl_arg<char> {
|
||||
return {s};
|
||||
}
|
||||
#endif // FMT_USE_NONTYPE_TEMPLATE_ARGS
|
||||
|
Loading…
x
Reference in New Issue
Block a user