eneswitwit / Sumfactorization

1 stars 0 forks source link

Use static_assert if possible #8

Open masterleinad opened 7 years ago

masterleinad commented 7 years ago

Currently, there are code fragments such as

 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!");