I've overloaded std::ostream & operator<<
many times for different data types in the past and never had a problem. However, for some reason, the following overload for Eigen::AlignedBox2i
does not work with boost::log
std::ostream & operator<<( std::ostream & os, Eigen::AlignedBox2i const & rect )
{
os << "foo";
return os;
}
std::cout << Eigen::AlignedBox2i();
works just fine, but BOOST_LOG_TRIVIAL( debug ) << Eigen::AlignedBox2i();
results in a number of compiler errors, starting with:
D:\dev\ext\boost_1_80_0\boost/log/utility/formatting_ostream.hpp(929,16): error C2679: binary '<<': no operator found which takes a right-hand operand of type 'T' (or there is no acceptable conversion)
Any idea what is happening here?