Soo who can help me with this...I'm still learning the in's and outs of OOP, mostly methods and how to declare them. Here's the error:
In file included from main.cpp:2:0:
Mat.h: In member function ‘D& Mat<D>::operator()(int, int) const [with D = double]’:
Mat.h:100:13: instantiated from ‘std::ostream& operator<<(std::ostream&, const Mat<D>&) [with D = double, std::ostream = std::basic_ostream<char>]’
main.cpp:9:18: instantiated from here
Mat.h:141:37: error: invalid initialization of reference of type ‘double&’ from expression of type ‘int’
And here's the code it's yelling at me for:
1 2 3 4 5 6 7
template< class D >
D & Mat<D>::operator()(constint row_index, constint col_index) const
{
if (row_index >= _rowsize || col_index >= _colsize) throw IndexError();
return (_p[row_index][col_index]);
}
Ok. I don't know why I didn't bother to look at that. I think I assumed that the array was D(= double) and I didn't even check. Alright, thanks. Fixed now