summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-05-02 13:55:11 +0200
committerMarc Mutz <marc.mutz@kdab.com>2017-05-03 09:21:41 +0000
commitd58c600543713a19bfcb9d764e0026a58799ec9c (patch)
treeb99dcbf3f239ad79a72f96b4323feacd590e30d2 /src/corelib
parent3792ab804dc803f8cbb167178e499f9d5d9b6310 (diff)
Remove QAddConst
It was added to support qAsConst(). When <type_traits> became mandatory, porting qAsConst() to std::add_const was forgotten. Change-Id: Ifb9b54d12554ce19dca4664642a8644f49aeb6af Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qglobal.h6
1 files changed, 1 insertions, 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 <typename T> struct QAddConst { typedef const T Type; };
-}
-
// this adds const to non-const objects (like std::as_const)
template <typename T>
-Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
// prevent rvalue arguments:
template <typename T>
void qAsConst(const T &&) Q_DECL_EQ_DELETE;