[RESOLVED] How come cout won't accept an object if it's been returned from a function?
I'm making a fairly simple matrix class and it's mostly working so far but I've found a curiosity when sending it to cout.
It seems like if I create a matrix4 object and then send it to cout, that works fine. But if I create the matrix4 as I send it to cout, then I get an error.
If I uncomment the penultimate line of the code below, I get a huge error message. But I would have thought that it was equivalent to the line above it, which works fine.
The get_transpose() function, the overloaded << operator and the start of the error message look like this:
Code:
matrix4 get_transpose() const;
std::ostream& operator << ( std::ostream& stream, matrix4& m );
matrix4_test.cpp:26: error: no match for 'operator<<' in 'std::cout << matrix4::get_transpose() const()'
Any ideas why it's going wrong or how I can fix it so that I can send matrix4s directly to cout the same as normal types? I've attached the relevant files in case they help.
Here's the problem code, the penultimate line in particular:
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.