diff --git a/src/base/config.hpp b/src/base/config.hpp index ffe9343..16ded3e 100644 --- a/src/base/config.hpp +++ b/src/base/config.hpp @@ -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_