Новый файл
This commit is contained in:
parent
8bbf5e6c6f
commit
26e43221d1
31
src/myx/qt/backports.hpp
Normal file
31
src/myx/qt/backports.hpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#ifndef MYX_QT_BACKPORTS_HPP_
|
||||||
|
#define MYX_QT_BACKPORTS_HPP_
|
||||||
|
|
||||||
|
#if ( defined ( TARGET_LSB_ID_AstraLinuxSE ) && defined ( TARGET_LSB_CODENAME_smolensk ) )
|
||||||
|
|
||||||
|
#define override
|
||||||
|
|
||||||
|
#if QT_VERSION <= 0x050700
|
||||||
|
#include <QtGlobal>
|
||||||
|
template< typename ... Args >
|
||||||
|
struct QOverload
|
||||||
|
{
|
||||||
|
template< typename C, typename R >
|
||||||
|
static constexpr auto of( R ( C::* pmf )( Args... ) )->decltype( pmf )
|
||||||
|
{
|
||||||
|
return( pmf );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 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 // if QT_VERSION <= 0x050700
|
||||||
|
#endif // if ( defined ( TARGET_LSB_ID_AstraLinuxSE ) && defined ( TARGET_LSB_CODENAME_smolensk ) )
|
||||||
|
|
||||||
|
#endif // MYX_QT_BACKPORTS_HPP_
|
Loading…
Reference in New Issue
Block a user