Remove asserts for unsigned integer >= 0

GCC 10 gives a warning
"comparison of unsigned expression in ‘>= 0’ is always true"
for these asserts since checking if an unsigned integer cannot
be negative and hence the statement gets droped.
This commit is contained in:
Matthias Grob
2020-07-20 15:10:49 +02:00
committed by Julian Kent
parent 0fd99c59f1
commit 7a3009f7a3
4 changed files with 0 additions and 23 deletions
-6
View File
@@ -28,17 +28,13 @@ public:
_data(const_cast<Matrix<Type, M, N>*>(data)) {
static_assert(P <= M, "Slice rows bigger than backing matrix");
static_assert(Q <= N, "Slice cols bigger than backing matrix");
assert(x0 >= 0);
assert(x0 + P <= M);
assert(y0 >= 0);
assert(y0 + Q <= N);
}
const Type &operator()(size_t i, size_t j) const
{
assert(i >= 0);
assert(i < P);
assert(j >= 0);
assert(j < Q);
return (*_data)(_x0 + i, _y0 + j);
@@ -47,9 +43,7 @@ public:
Type &operator()(size_t i, size_t j)
{
assert(i >= 0);
assert(i < P);
assert(j >= 0);
assert(j < Q);
return (*_data)(_x0 + i, _y0 + j);