Disable float-equal warnings in QGenericMatrix

Those warnings can cause compile errors if someone instantiates the
equality operator.

Pick-to: 5.15
Change-Id: I95fab87a424b2d359a8f3e22134f9d3ff6219703
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Lars Knoll 2020-06-16 10:45:33 +02:00
parent 57d46aef2a
commit 4d90725e77

View File

@ -219,6 +219,9 @@ Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator*
return *this;
}
QT_WARNING_PUSH
QT_WARNING_DISABLE_FLOAT_COMPARE
template <int N, int M, typename T>
Q_OUTOFLINE_TEMPLATE bool QGenericMatrix<N, M, T>::operator==(const QGenericMatrix<N, M, T>& other) const
{
@ -233,14 +236,11 @@ Q_OUTOFLINE_TEMPLATE bool QGenericMatrix<N, M, T>::operator==(const QGenericMatr
template <int N, int M, typename T>
Q_OUTOFLINE_TEMPLATE bool QGenericMatrix<N, M, T>::operator!=(const QGenericMatrix<N, M, T>& other) const
{
for (int row = 0; row < M; ++row)
for (int col = 0; col < N; ++col) {
if (m[col][row] != other.m[col][row])
return true;
}
return false;
return !(*this == other);
}
QT_WARNING_POP
template <int N, int M, typename T>
Q_OUTOFLINE_TEMPLATE QGenericMatrix<N, M, T>& QGenericMatrix<N, M, T>::operator/=(T divisor)
{