diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2020-03-26 15:23:17 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2020-03-26 15:23:17 +0000 |
| commit | 444456276dba1c9616ce40802b64d3bd958f013c (patch) | |
| tree | 8c21cdb1d6728d127a3b3d6c6324c5d95dcd1a68 /src | |
| parent | 9d9b51630bf7c3ce060620a8a6af8fd8e6587fff (diff) | |
| download | qmmp-444456276dba1c9616ce40802b64d3bd958f013c.tar.gz qmmp-444456276dba1c9616ce40802b64d3bd958f013c.tar.bz2 qmmp-444456276dba1c9616ce40802b64d3bd958f013c.zip | |
declare qAsConst for old Qt versions
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9312 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
| -rw-r--r-- | src/qmmp/qmmp.h | 9 |
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> |
