if (A_columns!=B_rows) {
std::cout << "Matrices not compatible for multiplication!" << std::endl;
return;
}
where A_columns and B_rows are template parameters. There is no reason to continue in this case and we can detect this already at compile time via
static_assert(A_columns == B_rows, "Matrices not compatible for multiplication!");
Currently, there are code fragments such as
where
A_columns
andB_rows
are template parameters. There is no reason to continue in this case and we can detect this already at compile time viastatic_assert(A_columns == B_rows, "Matrices not compatible for multiplication!");