Matrix::operator<< not working properly
See https://github.com/CExA-project/ddc/pull/433#discussion_r1590651750
I think a const might be missing:
std::ostream& operator<<(std::ostream& os) const
@EmilyBourne When you tried this function, do you remember if you were passing a const Matrix to the insertion operator << ?
Hmm good question. I don't remember but I was probably printing a Matrix via the SplineBuilder getter. If that was indeed the case, then it would be const
I have just checked and this seems to be unrelated to the constness:
/home/emily/Code/ddc/include/ddc/kernels/splines/spline_builder.hpp:497:15: error: no match for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘ddc::detail::Matrix’)
497 | std::cout << (*matrix) << std::endl;
| ~~~~~~~~~ ^~ ~~~~~~~~~
| | |
| | ddc::detail::Matrix
| std::ostream {aka std::basic_ostream<char>}
The somewhat absurd code:
(*matrix) << std::cout;
compiles correctly and prints the matrix (if I provide an arbitrary implementation of get_element)
Let's go back to the free function version then