From 4d83d379430d5c26c0711c1c8789b80eaaa3addb Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 13 May 2019 16:27:21 +0200 Subject: QMessageLogContext: simplify construction By using NSDMI. Change-Id: I171133b07ba2c7050e0d279caff0c393e03df182 Reviewed-by: Marc Mutz Reviewed-by: Thiago Macieira --- src/corelib/global/qlogging.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/corelib/global/qlogging.h') diff --git a/src/corelib/global/qlogging.h b/src/corelib/global/qlogging.h index 14c5d66bcd..4a528a2973 100644 --- a/src/corelib/global/qlogging.h +++ b/src/corelib/global/qlogging.h @@ -63,16 +63,15 @@ class QMessageLogContext { Q_DISABLE_COPY(QMessageLogContext) public: - Q_DECL_CONSTEXPR QMessageLogContext() - : version(2), line(0), file(nullptr), function(nullptr), category(nullptr) {} - Q_DECL_CONSTEXPR QMessageLogContext(const char *fileName, int lineNumber, const char *functionName, const char *categoryName) - : version(2), line(lineNumber), file(fileName), function(functionName), category(categoryName) {} - - int version; - int line; - const char *file; - const char *function; - const char *category; + Q_DECL_CONSTEXPR QMessageLogContext() noexcept = default; + Q_DECL_CONSTEXPR QMessageLogContext(const char *fileName, int lineNumber, const char *functionName, const char *categoryName) noexcept + : line(lineNumber), file(fileName), function(functionName), category(categoryName) {} + + int version = 2; + int line = 0; + const char *file = nullptr; + const char *function = nullptr; + const char *category = nullptr; private: QMessageLogContext ©ContextFrom(const QMessageLogContext &logContext) noexcept; -- cgit v1.2.3