Skip to content
Snippets Groups Projects
Commit c1404b4c authored by Markus Blatt's avatar Markus Blatt
Browse files

Merge branch 'fix/compiler-warning-unused-foreach' into 'master'

[foreach][cleanup] Only use return values in debug mode (silences warning)

See merge request !544
parents b487d083 1f3e6464
No related branches found
No related tags found
1 merge request!544[foreach][cleanup] Only use return values in debug mode (silences warning)
Pipeline #65160 passed
......@@ -167,8 +167,12 @@ std::pair<std::size_t,std::size_t> flatMatrixForEach(Matrix&& matrix, F&& f, std
{
auto&& entry = *colIt;
auto colIdx = colIt.index();
auto [ dummyRows, dummyCols ] = flatMatrixForEach(entry, f, rowOffset + rowIdx*blockRows, colOffset + colIdx*blockCols);
assert( dummyRows == blockRows and dummyCols == blockCols and "we need the same size of each block in this matrix type");
#ifndef NDEBUG
// only instantiate return value in debug mode (for the assert)
auto [ numRows, numCols ] =
#endif
flatMatrixForEach(entry, f, rowOffset + rowIdx*blockRows, colOffset + colIdx*blockCols);
assert( numRows == blockRows and numCols == blockCols and "we need the same size of each block in this matrix type");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment