mirror of
https://github.com/fmtlib/fmt.git
synced 2026-02-05 17:30:06 +08:00
Simplify warning suppression
This commit is contained in:
parent
71c63792dd
commit
cf74caae38
@ -223,11 +223,6 @@
|
||||
#else
|
||||
# define FMT_PRAGMA_CLANG(x)
|
||||
#endif
|
||||
#if FMT_MSC_VERSION
|
||||
# define FMT_MSC_WARNING(...) __pragma(warning(__VA_ARGS__))
|
||||
#else
|
||||
# define FMT_MSC_WARNING(...)
|
||||
#endif
|
||||
|
||||
// Enable minimal optimizations for more compact code in debug mode.
|
||||
FMT_PRAGMA_GCC(push_options)
|
||||
@ -1741,9 +1736,12 @@ template <typename T> class buffer {
|
||||
|
||||
protected:
|
||||
// Don't initialize ptr_ since it is not accessed to save a few cycles.
|
||||
FMT_MSC_WARNING(suppress : 26495)
|
||||
constexpr buffer(grow_fun grow, size_t sz) noexcept
|
||||
: size_(sz), capacity_(sz), grow_(grow) {}
|
||||
: size_(sz), capacity_(sz), grow_(grow) {
|
||||
#if FMT_MSC_VERSION
|
||||
ptr_ = nullptr; // Suppress warning 26495.
|
||||
#endif
|
||||
}
|
||||
|
||||
constexpr buffer(grow_fun grow, T* p = nullptr, size_t sz = 0,
|
||||
size_t cap = 0) noexcept
|
||||
|
||||
@ -156,6 +156,12 @@
|
||||
# define FMT_CONSTEXPR_STRING
|
||||
#endif
|
||||
|
||||
#if FMT_MSC_VERSION
|
||||
# define FMT_MSC_WARNING(...) __pragma(warning(__VA_ARGS__))
|
||||
#else
|
||||
# define FMT_MSC_WARNING(...)
|
||||
#endif
|
||||
|
||||
// GCC 4.9 doesn't support qualified names in specializations.
|
||||
namespace std {
|
||||
template <typename T> struct iterator_traits<fmt::basic_appender<T>> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user