
Hello, I want to put a custom object called DynamicVector on the BOOG_LOG_SEV stream. For that I defined an operator<< template<typename Vector> typename std::enable_if<tarch::la::IsVector<Vector>::value, std::ostream&>::Type operator<< (std::ostream & os, const Vector & vector); IsVector<Vector> will be true, since template<typename Scalar> struct IsVector<DynamicVector<Scalar> > { static const int value = true; }; The operator itself is working: // getCoords returns a DynamicVector<double> std::cout << inMesh->vertices()[j].getCoords(); // compiles just fine. but BOOST_LOG_SEV(_log, boost::log::trivial::severity_level::error) << inMesh->vertices()[j].getCoords(); gives an compile error: /usr/include/boost/log/utility/formatting_ostream.hpp:799:19: error: invalid operands to binary expression ('ostream_type' (aka 'basic_ostream<char_type, traits_type>') and 'const tarch::la::DynamicVector<double>') strm.stream() << value; str.stream() seems to be an ostream_type which is an basic_ostream<char_type, traits_type>. I wonder why this isn't convertible to std::ostream, like http://stackoverflow.com/questions/17269499/overloading-operator-for-boost-l... and the comment at http://www.boost.org/doc/libs/1_54_0/boost/log/utility/formatting_ostream.hp... suggest. Any help appreciated! Thanks, Florian
participants (1)
-
Florian Lindner