qAsConst для Qt < 5.7

This commit is contained in:
Andrei Astafev 2019-10-08 06:48:18 +03:00
parent 424c669eb6
commit e257c339d6

View File

@ -19,7 +19,16 @@ struct QOverload
return( pmf );
}
};
#endif
#endif
// 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_BASE_CONFIG_HPP_