aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/qmmp/qmmp.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qmmp/qmmp.h b/src/qmmp/qmmp.h
index 3ff612b7f..5e7800bf0 100644
--- a/src/qmmp/qmmp.h
+++ b/src/qmmp/qmmp.h
@@ -39,6 +39,15 @@
#define QStringToFileName(s) s.toLocal8Bit().constData()
#endif
+#if (QT_VERSION < QT_VERSION_CHECK(5, 7, 0))
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) noexcept { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) = delete;
+#endif
+
/*! @brief The Qmmp class stores global settings and enums.
* @author Ilya Kotov <forkotov02@ya.ru>