mr_ped Messages: 826 Registered: November 2005 Location: Czech Republic - Praha
Experienced Contributor
Eigen has it's own Matrix type, which has it's own "to std::string" conversion routine.
Which makes std::cout << Eigen::MatrixXd to compile without problem.
Cout() is not std::ostream (or what's the base output stream in STL/C++, I have no idea), it's Upp::output stream (not sure about exact class name either).
So the compiler can't find the conversion function from Eigen::MatrixXd to Upp::String (which is most common input format for "<<" for Upp::ostream.
And dolik did just supply you with one conversion function for such situation.
NAMESPACE_UPP is macro to open Upp:: namespace, so you are with the next code defining
Upp::String Upp::AsString(const Eigen::MatrixXd& m)
function.
Then later during compiling "Cout() << m" that new method is perfect fit for silent auto conversion.