From d58c600543713a19bfcb9d764e0026a58799ec9c Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 2 May 2017 13:55:11 +0200 Subject: [PATCH] Remove QAddConst It was added to support qAsConst(). When became mandatory, porting qAsConst() to std::add_const was forgotten. Change-Id: Ifb9b54d12554ce19dca4664642a8644f49aeb6af Reviewed-by: Thiago Macieira Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/global/qglobal.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index e04d9fdefa..14c17d1ce3 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -923,13 +923,9 @@ QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantic # endif #endif -namespace QtPrivate { -template struct QAddConst { typedef const T Type; }; -} - // this adds const to non-const objects (like std::as_const) template -Q_DECL_CONSTEXPR typename QtPrivate::QAddConst::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; } +Q_DECL_CONSTEXPR typename std::add_const::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; } // prevent rvalue arguments: template void qAsConst(const T &&) Q_DECL_EQ_DELETE;