mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-19 20:18:49 +00:00
Avoid shadowing warnings in FMT_STRING
This commit is contained in:
parent
a99fbe67b9
commit
068d20bc31
@ -3511,18 +3511,16 @@ FMT_END_NAMESPACE
|
|||||||
|
|
||||||
#define FMT_STRING_IMPL(s, ...) \
|
#define FMT_STRING_IMPL(s, ...) \
|
||||||
[] { \
|
[] { \
|
||||||
struct str : fmt::compile_string { \
|
/* Use a macro-like name to avoid shadowing warnings. */ \
|
||||||
|
struct FMT_STRING : fmt::compile_string { \
|
||||||
using char_type = typename std::remove_cv<std::remove_pointer< \
|
using char_type = typename std::remove_cv<std::remove_pointer< \
|
||||||
typename std::decay<decltype(s)>::type>::type>::type; \
|
typename std::decay<decltype(s)>::type>::type>::type; \
|
||||||
__VA_ARGS__ FMT_CONSTEXPR \
|
__VA_ARGS__ FMT_CONSTEXPR \
|
||||||
operator fmt::basic_string_view<char_type>() const { \
|
operator fmt::basic_string_view<char_type>() const { \
|
||||||
return {s, sizeof(s) / sizeof(char_type) - 1}; \
|
return {s, sizeof(s) / sizeof(char_type) - 1}; \
|
||||||
} \
|
} \
|
||||||
} result; \
|
}; \
|
||||||
/* Suppress Qt Creator warning about unused operator. */ \
|
return FMT_STRING(); \
|
||||||
(void)static_cast<fmt::basic_string_view<typename str::char_type>>( \
|
|
||||||
result); \
|
|
||||||
return result; \
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user