diff --git a/include/myx-example-features/private/qasconst.hpp b/include/myx-example-features/private/qasconst.hpp new file mode 100644 index 0000000..123a05c --- /dev/null +++ b/include/myx-example-features/private/qasconst.hpp @@ -0,0 +1,23 @@ +#ifndef MYX_BACKPORTS_QASCONST_HPP_ +#define MYX_BACKPORTS_QASCONST_HPP_ + +#pragma once + +#include + +#if QT_VERSION < 0x050700 + +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 // if QT_VERSION < 0x050700 + +#endif // ifndef MYX_BACKPORTS_QASCONST_HPP_ diff --git a/src/myx-example-features/main.cpp b/src/myx-example-features/main.cpp index b5b7f9e..3827562 100644 --- a/src/myx-example-features/main.cpp +++ b/src/myx-example-features/main.cpp @@ -3,6 +3,7 @@ */ #include +#include #include